If you're a fan of mustard, wasabi or any other savory flavors that come from plants in the order Brassicales—cabbage, horseradish, kale or mustard—you have caterpillars' distaste for those exact flavors to thank for their existence. 

Some 90 million years ago, ancient Brassicales plants evolved to produce chemicals called glucosinolates as a defense against the cabbage butterfly caterpillars that were decimating the vegetation. This key component of mustard oil not only tasted bitter to the bugs, it was toxic for them—making it the perfect defense, at first. But over the course of the next 10 million years, the caterpillars, in turn, evolved a protein that allowed them to digest the chemical defense. This gave them a new food source all to themselves. The cabbage butterflies flourished and evolved into several new species, all with the ability to eat mustard oil plants.

Needing a new defense, the plants' evolution added in different amino acid ingredients to make new glucosinolates that allowed them to branch out into more species. And while that worked for a little while (you know, hundreds of thousands of years) you can probably guess what happened next.

This back and forth over the millennia was essentially an evolutionary arms race during which a pair of species pushed each other to keep up. The coevolution of cabbage butterflies and Brassicales plants has been known about for a while. But for a paper published this month in Proceedings of the National Academy of Sciences, a group of scientists led by J. Chris Pires, a plant evolutionary biologist at the University of Missouri, made a pair of evolutionary family trees. When they lined the two trees up, they noticed that the branching of the different species corresponded perfectly to the opposing group's new genetic feature. They were able to infer that they were not simply evolving alongside one another but in direct response to each other.

This worked out well for humans, who now enjoy a range of cruciferous vegetables that evolved from those ancient cabbage plants when the family tree expanded, and which get most of their flavor from the glucosinolates that originally developed to ward off caterpillars.

"Why do you think plants have spices or any flavor at all? It's not for us," Pires told NPR's The Salt. "They have a function. All these flavors are evolution."