In a paper published Monday in the journal JEZ-Molecular and Developmental Evolution, Yale biologist Gunter Wagner marked a climax in a long-smoldering debate about the origin of the female orgasm by finally pointing a finger at its biological roots.

“In the case of male orgasm, it’s clear what it’s good for,” Wagner told Inverse. The female orgasm? Not so much, perplexing philosophers, lovers, and biologists alike. Aristotle famously wondered whether females really need to enjoy sex as much as they do (to his credit, the old Greek was strongly pro-pleasure).

At this point in human evolution, the female orgasm is “sort of an extracurricular activity outside of sex — outside of making babies,” Wagner continued. But, he argues in his paper, it wasn’t always that way.

Wagner and his co-author Mihaela Pavličev, Ph.D., were fed up with the usual theories that try to explain away the female orgasm. One school of thought argues that it has some unacknowledged role in reproductive success — an argument that falls flat because, as Wagner points out, “Women can have babies without ever having an orgasm,” he says.

Another (strikingly male-centric) theory insists the female orgasm only developed as what Wagner calls a “happy accident,” a byproduct of evolution’s insistence that dudes of all species figure how to sling sperm. Genetically, the clitoris and the penis are basically the same thing, so the thinking is that the female orgasm is just a side effect of the evolution of male orgasm. But Wagner wasn’t convinced: Too many of these theories focused on the female orgasm’s role in human biology and not enough on its role in other species. To really figure out why they were important enough to persist throughout millennia of evolution, he explains, it was crucial to look at other climaxing animals.

So that’s exactly what he did. He dug deep into the phylogenetic tree, looking for traits in other species that resembled the female orgasm and tried to figure out how the orgasm measurably affected other animals.

And after considering the orgasms of other species, he came to a great realization: “It was the reflex that led to ovulation in response to copulation.” In plain English, the male-induced female orgasm — fueled by her release of hormones like prolactin and oxytocin — was originally an eject button for eggs in the ovary. Without it, pregnancy — and survival — would have been impossible.

This, he argues, was also the case for human ancestors until a quirk of evolution empowered eggs to ditch the nest on their own. Species within the primate tree, he argues, developed this ability through random mutation; like human females, their eggs are produced and released whether or not they’re lucky enough to climax during sex and said eggs are either fertilized or not.

And so, the female orgasm was rendered non-essential — but, that doesn’t mean it wasn’t still incredibly important. “This reflex became superfluous with the evolution of spontaneous ovulation, potentially freeing female orgasm for other roles,” the authors write in their paper.

If Wagner’s theory is right, it can shed light on a mystery that’s been frustrating heterosexual-sex-having females for millennia: Why the hell don’t we get to orgasm every time we have sex? This issue, described by Harvard researcher Elisabeth Anne Lloyd, Ph.D., as “orgasm/intercourse discrepancy,” becomes slightly less opaque — but no less maddening — when you consider the coincidence Wagner stumbled upon when contemplating vaginas throughout the animal kingdom: Around the time spontaneous ovulation developed, there was an anatomical change where the clitoris moved outside of the vagina, “which means that it’s no longer necessarily stimulated during intercourse,” he explains. “It may also explain why the large majority of women do not reach orgasm during intercourse.”

And yet: Rendered non-essential, the human female orgasm defiantly persists, massaged into our genes by, perhaps, the importance of climax-induced hormones in forming relationships and female choice, or, maybe, simply, our species’ pursuit of pleasure — whatever the case, Wagner’s future research will endeavor to find out.

After all, he points out, “most women have the capability to reach orgasm through clitoris stimulation.” Surely, there’s a reason evolution didn’t rub it out.