If you need additional proof that science is stranger than fiction, just take a peek at this poor hawkmoth caterpillar. That mass of peach-colored fluff that’s dangling from its beleaguered body? You’re looking at dozens of silk cocoons spun by the offspring of a parasitic wasp that laid her eggs inside the unsuspecting caterpillar several weeks prior. When the eggs hatched shortly thereafter, the very hungry wasp larvae started feeding on their host’s bodily fluids, carefully avoiding all critical organs so as not to kill off their food source too quickly. Eventually, once they had undergone several molts inside their fleshy home and their teeth were sharp enough to pierce the caterpillar’s skin, they chewed their way out, descended a short distance down a delicate silk thread, and built a case in which to undergo their final transformation.

The story, believe it or not, gets stranger still. For the past 40 years or so, scientists have known that when a wasp mom-to-be deposits her eggs inside a caterpillar, she also inserts an insurance policy—a symbiotic virus, which she replicates in her ovaries, that prevents the caterpillar’s immune system from attacking her growing larvae. There are currently more than 17,000 known species of braconid parasitic wasps, and they each host their own species of virus, but every bracovirus performs the same basic function: Interfering with the caterpillar’s immune system.

Several years ago, a team led by scientists at the University of Washington made a startling new discovery about this complicated web of interactions: Many caterpillars have incorporated genes from the wasps’ viruses into their own genomes. These genes—hard won by caterpillars that somehow survived the horrific fate of being eaten alive from the inside out—now protect a number of species of butterflies and moths from a different, and even deadlier, group of viruses. Natural selection, it seems, can sometimes turn even the harshest of insults inside out to reveal a shiny silver lining. (Really, you couldn’t concoct a crazier story if you tried.)

Yasuní National Park, Ecuador

Lucas Bustamante

Lucas Bustamante is a wildlife photographer and biologist from Ecuador. He is the photographic director of Tropical Herping, an institution he co-founded in 2009 to help preserve tropical reptiles and amphibians through tourism, photography, education, and research. His work has been featured in National Geographic, BBC Wildlife Magazine, and many other publications. He is a Wildlife Photographer of the Year and Nature’s Best Windland Smith Rice prize winner, and is an Associate Fellow of the International League of Conservation Photographers. Bustamante’s primary objective is to use photography as a tool to promote wildlife conservation.

bioGraphic is powered by the California Academy of Sciences, a renowned scientific and educational institution dedicated to exploring, explaining, and sustaining life on Earth.