A taurus scarabEduardo Zattara

When Cristina Ledón-Rettig first noticed worms in the little balls of poop, she thought something had gone wrong.

Ledón-Rettig studies dung beetles, and she breeds one species—the taurus scarab—in her lab at Indiana University. That involves collecting fresh cow dung, wringing out some of the moisture through cheesecloth, partitioning it into small balls, and putting a single beetle egg on each one. This simulates the “brood balls” that wild beetles naturally prepare for their young. One day, Ledón-Rettig noticed that the artificial brood balls were full of nematode worms—small, slender, and wriggling. “When we saw them, we thought they were killing the beetles,” she says.

A Diplogastrellus nematode (Erik Ragsdale)

It was a reasonable assumption. Nematodes, which belong to a different animal group than earthworms, come in tens of thousands of species. Whenever they’re found with insects—which is often—that association is almost always viewed in a negative light. Sometimes the nematodes parasitize or infect the insects; at best, they’re attracted to an insect’s corpse.

But after talking to her colleague Erik Ragsdale, who studies nematodes, Ledón-Rettig learned that the worms sometimes harmlessly hitchhike on insect bodies. “I asked if they could be beneficial. He said there’s absolutely no evidence either way,” Ledón-Rettig says. So she found some.

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.”

But if the nematodes are universally beneficial, you’d expect every dung beetle to carry them—and that’s not the case. “It could be that under some circumstances that we didn’t test, the nematodes are neutral or detrimental,” says Ledón-Rettig. Adds Bulgheresi: “I am very curious to know whether the nematodes depend on the beetles.”

Ray Hong, a nematode specialist from California State University, adds that nematodes have their own microbiomes, and wonders if that’s behind the benefits to the beetle. Some parasitic nematodes kill insects using toxins created by bacteria, which the worms house in special organs. Perhaps a more beneficent bacterium, within the nematodes that live with the dung beetles’, could help the beetles’ larvae.

“Given an estimated million species of nematodes, most of them yet to be described, there are certainly enough beetle species to match each one,” says Hong. “I think we are just beginning to appreciate the extent of these interactions.”

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.