The distinctive, earthy smell of fresh rain isn’t just wet dirt. According to new research, it’s the chemical potion bacteria have been using to attract tiny arthropods for more than 400 million years.

Scientists have known about the chemical compound behind the evocative scent of newly moistened soil, called geosmin, since the 1960s, but only now have researchers arrived at what may be an explanation of its purpose, reports Rich Haridy for New Atlas.

Creatures from across the animal kingdom are highly attuned to the distinctive waft of geosmin, including flies, camels and people. We humans are not famous for our olfactory prowess, yet we can reportedly detect the signature musk of geosmin in concentrations as low as 100 parts per trillion. To put that in perspective, sharks’ famous blood sniffing snouts can only suss out one part per million in seawater.

The bacteria responsible for this musty odor are in the genus Streptomyces.

The Streptomyces genus is well known for producing unique chemical byproducts, which form the basis of many antibiotic, antifungal and anticancer compounds. But each of these unique compounds are only made by a small percentage of the more than 500 known species in the genus. Yet, 120 of the 122 species the researchers studied possessed the gene to produce geosmin.

“The fact that they all make geosmin suggested that it confers a selective advantage on the bacteria, otherwise they wouldn’t do it,” says Mark Buttner, microbiologist at the John Innes Centre and co-author of the study, in a statement.

Geosmin accompanies the spores of these bacteria, which are present in huge numbers in soils the world over, and Buttner and his colleagues suspected it could be a signal to some animal or insect that might help spread the spores.

To see what critters were drawn to the scent, the team set out a network of sticky traps in a woodland in Alnarp, Sweden. Some traps were baited with Streptomyces and others with a type of soy flour.

In these field experiments and in the lab, the pungent geosmin, and another compound called 2-methylisoborneol (2-MIB), released by the Streptomyces colonies attracted tiny, six-legged arthropods called springtails in droves, the researchers report last week in the journal Nature Microbiology. The researchers even inserted electrodes into the springtails’ antennae, and because the appendages twitched whenever the chemicals wafted by, researchers determined that antennae may be specifically tuned to geosmin and 2-MIB.

The results suggest these organisms evolved alongside one another to form a symbiotic relationship. Streptomyces uses geosmin to ring the dinner bell for hungry springtails, which eat the bacteria, and in return the arthropods spread the bacteria’s spores far and wide. The springtails spread the spores they’ve eaten through their poop while those stuck to their bodies simply slough off.

"This is analogous to birds eating the fruits of plants," says Buttner in a statement. "They get food but they also distribute the seeds, which benefits the plants."

There’s also evidence that these bacteria specifically prefer springtails to convey their spores. Of the myriad compounds produced by Streptomyces, many are deadly to fungi, insects and nematodes. Springtails, on the other hand, separated from the insect family tree roughly half a billion years ago and possess enzymes capable of coping with the many chemical cocktails of Streptomyces, reports Courtney Linder for Popular Mechanics.

“We used to believe Streptomyces spores were distributed by wind and water but there is little room for wind or water to do anything in the small air compartments in the soil,” says Buttner in a statement. “So, these small primitive animals have become important in completing the lifecycle of the Streptomyces, one of the most important sources of antibiotics known to science.”

The researchers write that the symbiosis they propose is likely to be hundreds of millions of years old. So, the next time you smell rain, know that the same scent swirling into your nostrils perfumed the dirt of the ancient Earth.