First, she examined wild-caught taurus scarabs and saw that they carry one particular nematode species in, of all places, their genitals. “They don’t go anywhere else—not the wings, horns, face, wherever,” Ledón-Rettig says. That makes sense, because the microscopic worms love moisture, and when traveling on a beetle, they need to find sheltered crevices so they don’t dry out. Those particular crevices make it very easy for the nematodes to spread. Adults can transmit them to their sexual partners. Mothers can also pass them to the next generation, by inadvertently inoculating their brood balls with the worms.

That’s a good thing, as Ledón-Rettig discovered. She created brood balls that had either been dosed with nematodes or frozen beforehand to kill off the worms, and showed that beetle larvae grow faster when the worms are around, and eventually transform into bigger adults.

The nematodes, it turns out, are terraformers. They change the community of bacteria and fungi that live on the brood ball, suppressing certain species while boosting others. The bacteria that become more common include species that are known to live in insect guts and help their hosts digest wood and other tough plant fibers. By contrast, many fungi, including species that could potentially infect the beetle larvae, became rarer. In other words, thanks to the nematodes, the larvae are more likely to encounter microbes that aid their digestion and less likely to encounter those that cause them harm.

It’s still unclear how exactly the nematodes restructure the microbial communities. The worms certainly eat microbes, so they might simply be removing certain species and allowing their competitors to flourish. Ledón-Rettig also suggests they could be “exuding chemicals that change what bacteria can survive and what cannot.”

Silvia Bulgheresi of the University of Vienna says this cements the idea that we should think of animals as “holobionts”—a word that refers to the animal itself, as well as the entire community of creatures that shares its life. A dung beetle, for example, is not just an individual, but also the sum of the nematodes in its genitals, the bacteria in its gut, and more.

There are many animals that pass beneficial microbes onto their young. Human mothers slather their babies in vaginal microbes during birth. Tsetse flies nourish their grubs on a microbe-rich fluid that’s analogous to milk. Koalas package eucalyptus-digesting bacteria into a special poop that their joeys eat. Beewolf wasps daub the walls of their larval nurseries with antibiotic-producing microbes that they squeeze from their heads.

The dung beetle example is different. These animals are passing down other animals to the next generation. Anne Estes of Towson University says that the closest analogy, surprisingly enough, might be to humans and dogs. “The microbes human infants pick up in their first year of life influence whether they end up developing allergies, asthma, and more,” Estes says. “And studies have found that having dogs in a baby’s environment brings in different kinds of microbes and decreases the risk of many of these non-communicable diseases.”