Earthworms in rich organic soil. As they burrow, the worms consume soil in order to remove nutrients from decaying organic matter such as leaves and roots. (Courtesy of Manuel Liebeke, Imperial College London)

Let's all take a moment and thank the worms. Seriously, without them (and, to be fair, all of their fellow dirt friends), our world would look dramatically different.

The earthworm is just one example of what is called a detritivore — which includes all the bugs, fungi and bacteria tasked with eating up the dead things in the world and turning them into something that plants can use to grow. Scientists are just now solving the mystery on how worms survive the messy job.

[This freaky ancient worm shows what spider and insect ancestors might have looked like]

The natural defenses of dead plants -- which are designed to inhibit enzymes in the gut to prevent digestion -- would be toxic for any other animal. But a group of researchers from Imperial College London have discovered new molecules in the worm gut, named drilodefensins, that can counteract the toxins, breaking them down the way that dish liquid breaks apart grease.

"Without drilodefensins, fallen leaves would remain on the surface of the ground for a very long time, building up to a thick layer," said Jake Bundy, an author of the study and a professor at Imperial College, in a statement. "Our countryside would be unrecognizable, and the whole system of carbon cycling would be disrupted."

The amount of drilodefensin in worms was visualized by means of imaging techniques based on mass spectrometry and merged as pseudocolors onto a cross-section of an earthworm. (Courtesy of Manuel Liebeke, Imperial College London)
The amount of drilodefensin in worms was visualized by means of imaging techniques based on mass spectrometry and merged as pseudocolors onto a cross-section of an earthworm. (Courtesy of Manuel Liebeke, Imperial College London)

The scientists' work, published Tuesday in the journal Nature Communications, was made possible thanks to new microscopic chemical visualization techniques. The researchers found that the drilodefensins are so abundant that they estimate there is at least two pounds of the chemical present for every person on earth.

That doesn't mean worms have an excess of their secret weapon, though. The researches also discovered that worms recycle their drilodefensins to use it multiple times.

Overall, the takeaway is that when worms aren't squirming on roads after a good rain or falling from the sky in Norway, they're doing some pretty important things.

Read more:

Uh-oh: One of the world’s worst invasive species just showed up in the United States

Watch doctors lure a worm out of a boy’s eye with … basil?

‘Worms from hell’ unearth possibilities for extraterrestrial life

What is this green, slimy worm?