A new study, dubbed the Red Queen Hypothesis, finds that when C. elegans worms reproduce asexually, parasites easily drive them to extinction.

Say a thank you to the pathogens and parasites of the world: Without them, there might be no such thing as sex.

A new study finds that in organisms that can reproduce alone or with a partner, sexual reproduction is the result of a deadly arms race between host and pathogen. Without the presence of pathogens, the host organism sticks with the tried-and-true method of asexual breeding. When threatened by a continually evolving pathogen that gets better and better at killing its host, however, the host organism starts seeking out sex partners.

"You actually need these pathogens or parasites to be co-evolving for sex to be maintained," study author Levi Morran, a postdoctoral researcher at Indiana University, told LiveScience.

Why have sex?

Despite the fact that sex is strikingly widespread, it's a costly way of continuing a species. Sexual reproduction requires males, which can't make offspring on their own. That effectively cuts the breeding size of the population in half compared to organisms that can bud off clones of themselves at will.

In trying to explain why animals would chose costly sexual reproduction over asexual reproduction, scientists have suggested the "Red Queen Hypothesis," named after a quote from Lewis Carroll's "Through the Looking Glass." In the book, the Red Queen tells Alice (of "Alice in Wonderland" fame) that in her world, "it takes all the running you can do to keep in the same place." The Red Queen hypothesis predicts that evolution works in the same way: When a predator evolves, its prey has to evolve just to stay alive. Stop running, and you die.

In this case, sexual reproduction allows an organism to mix and match its genes with another, facilitating the evolution of defenses against invaders. When threatened by pathogens, then, organisms should be driven to reproduce sexually just to stay ahead.

Previous field studies have shown that in the wild, snails that can reproduce both asexually and sexually chose the sexual route more often when there are many parasites in the environment. But those studies were outside of the lab, where it's hard to be sure that other factors weren't affecting the results. [Read: The 10 Most Diabolical and Disgusting Parasites]

Testing the Red Queen

Morran and his colleagues wanted to test the idea that co-evolution can cause sex directly. They genetically modified a population of roundworms called C. elegans so that some could reproduce only asexually and others had to have sex to reproduce. A third group of C. elegans was left in its wild form. About 20 to 30 percent of that wild group reproduces sexually.

Next, all three groups of worms were exposed to S. marcescens bacteria, which can kill C. elegans within 24 hours. Some of the worms were exposed to dead, and thus harmless, bacteria, while others were exposed to bacteria that were alive but unable to evolve. A third group of worms was exposed to S. marcescens that were allowed to co-evolve along with their hosts.

Sexually reproducing C. elegans did just fine in all three conditions, Morran said. With their ability to co-evolve along with their bacteria nemeses, the worms weren't "just sitting ducks" for infection, he said. Asexual C. elegans also did fine when they didn't encounter bacteria, and they likewise survived meetings with the bacteria that were unable to evolve. But when asexual worms met co-evolving bacteria, it was a C. elegans slaughter.

"When we allowed the bacteria to co-evolve with the host, it actually drove the host to extinction in fewer than 20 generations, which is incredibly rapid," Morran said. "It even exceeded my expectations of what would happen."

Notably, the wild-type worms became sex fiends in the presence of bacteria: Their rate of sexual reproduction shot up to more than 70 percent. But when the bacteria weren't co-evolving, the worms reverted to asexual reproduction in a few generations. It took the constant pressure of a co-evolving pathogen to keep sex in the picture.

Evolving sex

Even if every dangerous pathogen disappeared overnight, humans would still be stuck with sex. But the study suggests that way, way back in our evolutionary lineage, it may have been parasites, bacteria and viruses that drove our ancestors to mate, Morran said.

"This study does not prove that co-evolving parasites were the reason," he said. "But what this study does is set up a very plausible explanation for the evolution of sex."