Look closely up in the trees of a shade-grown cacao plantation in eastern Costa Rica, and you’ll see an array of small furry faces peering back at you. Those are three-toed sloths that make their homes there, clambering ever so slowly into the upper branches to bask in the morning sun. You might also spot them munching on leaves from the guarumo tree, which shades the cacao plants.

Scientists have long known that this tree is important to the diets of sloths. Its foliage is highly nutritious, available all year and easy for the creatures to digest. But in a new study published Tuesday in Proceedings of the Royal Academy B, researchers report that a population of sloths with more guarumo trees in their cacao plantation habitat had more babies and were more likely to survive.

[Like the Science Times page on Facebook. | Sign up for the Science Times newsletter.]

Their findings suggest that the tree’s presence can help ensure the health of sloth populations even in environments that have already been disturbed by humans, like farms. It also shows how animals that have a specialized ecological niche, while traditionally thought of as vulnerable, can persist in changed circumstances as long as the resource that they depend on is available.

For almost ten years, Jonathan Pauli and M. Zachariah Peery, professors at the University of Wisconsin, and their colleagues have been tracking a group of sloths in Costa Rica. The animals are equipped with radio collars that transmit their location five or six times a month, so the team knows where each sloth’s usual territory is. The team has also taken DNA samples and figured out the sloths’ family tree, so they can tell which individuals are having the most babies.