For most animals, the milkweed plant is far from appetizing: It contains nasty toxins called cardenolides that can make the creatures vomit and, should they ingest enough, cause their hearts to beat out of control.

Yet some insects appear entirely unfazed by the powerful poison. The monarch butterfly’s colorful caterpillars, for example, devour milkweed with gusto — in fact, it is the only thing they ever eat. They can tolerate this food source because of a peculiarity in a crucial protein in their bodies, a sodium pump, that the cardenolide toxins usually interfere with.

All animals have this pump. It’s essential for physiological recovery after heart muscle cells contract or nerve cells fire — events that are triggered when sodium floods into the cells, causing an electrical discharge. After the firing and contracting is done, the cells must clean up, and so they turn on their sodium pumps and expel the sodium. This restores the electrical balance and resets the cell to its usual state, ready again for action.

Cardenolides are noxious because they bind to key parts of these pumps and prevent them from doing their job. This makes animal hearts beat stronger and stronger, often ending in cardiac arrest.

But since animals are under constant competition for food sources, the ability to eat plants that are toxic to others offers a fantastic opportunity, and many insects have evolved ways to do so.

Two papers, one of them published this week in the journal Nature and the other in eLife in late August, help to explain how such adaptations may have evolved. Through precise genetic changes, scientists created fruit flies (of the species Drosophila melanogaster) whose larvae survived a succession of milkweed-based meals.

Scientists have known for some time that monarchs — and many of the other insects, from a total of six orders, that feed on milkweed or other cardenolide-producing plants — have mutations in at least one of the genes that carry instructions for making sodium pumps. Some of these result in the replacement of one of the amino acids that the pump — like all proteins — is built from, making it harder for cardenolides to bind to it. Researchers assumed that one or more of these changes carry the key to making milkweed palatable, but without testing their effect in live animals, they couldn’t know for sure.

And if more than one mutation was needed to tolerate milkweed toxins, how did the trait ever evolve in the insect? If a plant is still toxic after one mutation, what selective advantage would that first mutation provide, to enable an insect to evolve the whole suite of needed changes?

In 2012, evolutionary biologist Noah Whiteman, now at the University of California, Berkeley, and a colleague proposed in a commentary that one could answer the question by engineering the monarch sodium pump mutations into fruit flies. The endeavor turned out to be anything but easy: “I had no idea what I was getting myself into,” Whiteman says now. It took three years of tinkering, using the gene-editing technique CRISPR-Cas9, “and then still, only 1 in 720 flies would survive.” The larvae of those that did, though, could eat milkweed almost like a monarch.

In the wild, fruit flies eat yeast that’s found, for example, on rotting fruit. In the lab, they are fed a standard diet consisting of a slurry of malt, corn meal, yeast, agar and syrup. To do their experiment, Whiteman and his colleagues laced this staple with a dose of dried, ground-up milkweed leaves or purified toxins and tried to rear various gene-edited fly strains on this diet. Some flies had one mutation of three seen in the sodium pump gene of monarchs, and some had combinations.

The work, reported in Nature, showed that all three mutations individually increased the fruit flies’ chances of surviving the dangerous diet. But there was a twist. In the case of two of those three mutations — the ones that individually provide the most toxin resistance and appear to have shown up first and last within the monarchs’ family tree — the gene-edited flies were more prone to seizures. This was assessed using a standard test in which flies in a tube were shaken vigorously: Flies carrying the first or last mutation remained motionless far longer after being shaken than did normal flies.

CREDIT: THOMAS SHAHAN / FLICKR

In other words, “it looks as if the mutations protecting the flies against the toxin create a neurological vulnerability,” Whiteman says. But this wasn’t the case when flies also had another mutation — the one that likely appeared second during evolution of toxin resistance in monarchs. In flies carrying this combo, the neurological vulnerability was gone but the toxin resistance remained.

This helps to explain how the milkweed adaptation may have evolved in monarchs, says Whiteman, who coauthored an article about the constant evolutionary arms race between plants and herbivorous insects in the Annual Review of Ecology, Evolution, and Systematics. The last mutation to show up in the monarch lineage is the one that confers the greatest resistance to cardenolides, based on the fruit fly results. And there may be a reason it came in last: Present on its own, it also would have had the largest seizure effect, harming the monarchs.

“They needed to get the mutations in the right order,” Whiteman says. First, a mutation of small effect would have altered the structure of the sodium pump to provide some resistance, but also some neurological problems. The second mutation would have amended the pump structure slightly, thereby fixing that problem. By so doing, it would have prepared conditions for the third mutation — the one with the heftiest antitoxin effect. By itself, that third mutation would have created intolerable neurological issues. But with the second mutation already in place, all would be well, or at least much better.

“Biologists call this a constrained adaptive walk,” says Whiteman, “where one mutation is followed by another, in a predictable order, setting a species, or more than one, on a trajectory to higher fitness.”

Hopi Hoekstra, an evolutionary biologist at Harvard University, calls this one of her favorite studies in a long time. “To understand what happened in the past, we largely rely on organisms that occur today,” she says. “By measuring the interactions among mutations in a single protein, the authors have put forth a plausible step-by-step evolutionary trajectory, giving us an exciting glimpse into the past.”

The findings gel with work by evolutionary biologist Peter Andolfatto at Columbia University, who published a similar study in eLife in late August, using a different technique to change the flies’ genes. “The results of both studies largely line up, independently confirming that the evolutionary options may indeed have been somewhat limited” for the monarch, Andolfatto says.

The monarchs’ evolutionary innovation had an ecological ripple effect. Not only did resistance to the toxin open up a whole new source of food, but it also allowed the butterflies to repel predators by storing the toxins in their bodies.

Birds tend to find out the hard way which insects are unpalatable, by trial and error. But many toxic insects — monarchs among them — have evolved a similar palette of warning colors, so that fewer of them must be eaten to teach the birds a lesson.

“Once a bird learns that an insect that is bright yellow, orange or red is likely to have a terrible taste,” Whiteman says, “they will probably steer clear of all of them. These toxins changed everything.”