An apple falls in an orchard and attracts fruit flies. Soon, the fruit is riddled with larvae, tunnelling inside it and digesting it from within. It’s a maggot party and, according to a new study, the invitation is written by microbes.

Fruit flies are naturally attracted to the smells of ripe and rotting fruit, but their presence on a piece of fruit draws yet more of their peers over. Zachary Durisko and Reuven Dukas from McMaster University discovered this in 2013: they showed that larvae are attracted to the odours of fruit that are already occupied by other larvae. These smells weren’t coming from the fruit itself or from the yeasts that were fermenting it. What was the source?

To find out, student Isvarya Venu worked with both larvae and food that had been stripped of all their bacteria. She found that the germ-free food filled with germ-free larvae was no longer a draw for other fruit flies. The lack of microbes in the food doesn’t matter—indeed, larvae have no preference for normal food over germ-free food. What matters is the lack of microbes in the flies. Larvae attract more larvae, but not if they don’t have any bacteria.

Venu confirmed this by identifying two specific bacteria that live in normal fly larvae—Lactobacillus brevis and Lactobacillus plantarum. When they dosed the germ-free fruit and larvae with either of these two species, they suddenly became attractive to other larvae again.

The team believe that the fly microbes are releasing chemicals into the air that attract more flies. But why? Flies are already drawn to chemicals released by fermenting fruits and the yeast that grows upon them, which tell them that there’s food on hand. They can also sense pheromones released by other adults, which tell them that there are possible mates around. So why would they care about the smell of a larva’s microbes?

One possible answer is that it’s easier for a maggot to burrow into food that is already criss-crossed with the tunnels of other larvae, and speedy burrowing makes them less vulnerable to parasitic wasps. By detecting the scent of Eau de Microbe, the flies can find safer feeding sites.

Francois Leulier from ENS-Lyon says that the team needs to identify the airborne substances released by the microbes to really make their case, but that this is a “minor issue”. “Mating behaviour, lifespan, intestinal regeneration, host immunity, juvenile growth and now attraction to peers are all influenced by the flies’ microbial environment,” he says.

Microbes could also play important roles in the social lives of other animals. Bacteria in the scent glands of hyenas give them distinctive smells that vary according to their sex, age, and fertility. It’s possible that hyenas use the information encoded in these bacterial odours in their social lives. Humans also have bacteria in our armpits that change the way we smell—perhaps we also rely on these scents for information.

It’s hard to say for sure because human armpits and hyena glands are full of vast, complex communities of bacteria. By contrast, the flies have just a few species. That makes them ideal for experiments, says Kevin Theis from the University of Michigan, who led the hyena research. “They can conduct very controlled experiments with flies in which their microbiomes can be eliminated or manipulated, permitting them to conclusively demonstrate causality not just correlation,” he says. “For most animal-associated microbiome research, especially in studies of behaviour, this is uncommon and often infeasible.”

The fruit fly is a darling of laboratory science, which has featured in countless experiments. We know so much about its genome, how it develops from a single cell into a fully grown adult, and how its nervous system governs its behaviour. And yet, it’s becoming very clear that a fly is a product of itself and its microbes. We can’t understand the former without understanding the latter. I will be writing about research like this, and much more, in my first book I Contain Multitudes, due in 2016.

About Ed Yong

Ed Yong is a staff science writer at The Atlantic. His work has appeared in Wired, the New York Times, Nature, the BBC, New Scientist, Scientific American, the Guardian, the Times, and more. His first book I CONTAIN MULTITUDES—about how microbes influence the lives of every animal, from humans to squid to wasps—will be published in 2016 by Ecco (HarperCollins; USA) and Bodley Head (Random House; UK).

Follow Ed on Twitter

Who We Are

Phenomena is a gathering of spirited science writers who take delight in the new, the strange, the beautiful and awe-inspiring details of our world. Phenomena is hosted by National Geographic magazine, which invites you to join the conversation. Follow on Twitter at @natgeoscience.