Top: Three-toed sloth (Bradypus tridactylus) skeleton and depiction
Bottom: Two-toed sloth (Choleopus hoffmanni) skeleton and depiction
Despite their superficially similar appearances, and their overlapping ranges, the two-toed and three-toed (well, two-fingered and three-fingered, as they all have three toes) sloths had very different evolutionary paths, and only came out so similarly due to convergent evolution, thanks to their rainforest habitat. They are not very related at all, it turns out. Their last common ancestor (LCA) existed around 39 million years ago (mya) - to put that in perspective, the LCA of ALL current mammals (humans, bats, whales, sloths, all of us) was probably around 65-60 mya, and the LCA of humans and chimpanzees was only 9 mya! Seriously, they are NOT very related. They’re both about as related as they are to the other members of their order - the South American Anteaters.
The two-toed sloths evolved from the ancient Megalonychidae, which includes the Megalonyx and other skeletal giant sloths, whose ancestors lived in South America between ~7 mya and 5000 years BCE. Though obviously not helped by the new immigrants, the giant sloths had already suffered significant declines to their population due to environmental changes by the time that humans arrived. We may have eaten a few here and there, but we did not cause their extinction, unlike many of the giant Pleistocene mammals of North America. These days, there are two species of two-toed sloth - Hoffman’s and Linnaeus’.
Three-toed sloths, however, we’re not quite sure about. Either they evolved in ways we don’t have complete links to, or they evolved from specimens that didn’t leave fossils that we’ve found yet. Like two-toed sloths, we do think that they dwelt on the ground until the Holocene (~12,000 years BCE), but we don’t know for sure. However, around that time, the savannahs and woodland/prairie environments of a lot of Central and South America became replaced by rainforest, which would have caused evolutionary pressure for them to move to the trees. Currently, there are four species of three-toed sloth - the pygmy (critically endangered), pale-throated, brown-throated, and maned.
Both creatures are slow, arboreal (tree-dwelling), and have many insects, fungi, and blue-green algaes (which aren’t actually algae at all…) growing from their fur. The two-toed sloths are slightly quicker than the three-toed sloths (approximately 1650 and 800 ft/hour, respectively - at least on land! Three-toed sloths are actually quicker swimmers than they are on the ground, and two-toed sloths are not so good at the swimming). They generally (but not always) eat different tree species, and often overlap ranges.