A recent study shows caterpillars played a major role in the existence of the mustard on your hot dog and the horseradish in your shrimp cocktail.

The oils that create these condiments' flavors actually developed millions of years ago as a way for the plants that produce them to defend against hungry insects, the University of Missouri reported.

"We found the genetic evidence for an arms race between plants like mustards, cabbage and broccoli and insects like cabbage butterflies," said Chris Pires, an MU Bond Life Sciences Center researcher and associate professor of biological sciences in the College of Arts and Sciences. "These plants duplicated their genome and those multiple copies of genes evolved new traits like these chemical defenses and then cabbage butterflies responded by evolving new ways to fight against them."

The "zing" in mustard is produced by compounds called glucosinolates, and caterpillars don't have the same appreciation for this flavor as humans do. Brassicales (an order of plants in the mustard family) were found to have first developed this spicy defense around the time when dinosaur went extinct, and later diversified to produce more than 120 types of glucosinolates.

"Seeing the variation in the detoxification mechanisms among species and their gene copies gave us important evolutionary insights," said Hanna Heidel-Fischer, a lead author on the study based at the Max Plank Institute for Chemical Ecology in Germany.

To make their findings, a team of researchers looked at 9 existing Brassicales genomes and also generated transcriptomes (the set of all RNA in a cell). This method allowed the researchers to create a map of the evolutionary family tree of these species to determine when certain changes occurred. The team identified three evolutionary "waves" that occurred over the past 80 million years that allowed the plants to develop their defense tactics.

"We found that the origin of brand-new chemicals in the plant arose through gene duplications that encode novel functions rather than single mutations," said Pat Edger, a former MU post doc and lead author on the study. "Given sufficient amounts of time the insects repeatedly developed counter defenses and adaptations to these new plant defenses."

The findings back up the idea of co-evolution that was first proposed by renowned biologists, Peter Raven and Paul Erhlich 50 years ago. Gaining insight into this concept could lead to breakthroughs in the agriculture industry.

"If we can harness the power of genetics and determine what causes these copies of genes, we could produce plants that are more pest-resistant to insects that are co-evolving with them-it could open different avenues for creating plants and food that are more efficiently grown," Pires said.

The findings were published in a recent edition of the Proceedings of the National Academy of Sciences (PNAS).

WATCH: