In order to protect themselves from hungry herbivores, plants release a defense mechanism that makes them taste foul.

Food-stressed caterpillars can be quick to resort to cannibalism.

Some plants have been found to use nature’s dog-eat-dog world to their advantage, forcing herbivores to become cannibals when the plants feel threatened by a caterpillar’s endless appetite.

A new study published in the Nature Ecology and Evolution journal found that when some plants are under attack from hungry herbivores, they emit defenses that make themselves incredibly foul-tasting to caterpillars, which spurs the caterpillars to eat each other.

“Plants can defend themselves so much that they food-stress the herbivore, and then the herbivores determine that rather than have plants on their menu, they should have caterpillars at the top of their menu,” said John Orrock, the author of the study and a researcher in the Department of Zoology at the University of Wisconsin, Madison.

Orrock and his research team sprayed tomato plants with methyl jasmonate—a substance plants produce in response to environmental stresses—to trigger the plants’ defense mechanisms. This chemical allowed the plant to change its chemistry, which made it less appetizing to the beet armyworm caterpillars that were placed on a treated plant.

This phenomenon has been documented in a variety of plants, and research has suggested that plants can sense when surrounding plants are under attack, which can spur the production of methyl jasmonate in entire communities of plants. (Read more about how plants listen for caterpillars to prompt defenses.)

“What I find most interesting is that general idea that most plants use information from their environment and they…