Soccer fans call it brave goalkeeping, the act of springing into a star shape in front of an attacker who is about to kick the ball as hard as possible toward the goal. As I shuffled from the field, bent forward, eyes watering, waiting for the excruciating whack of pain in my crotch to metamorphose into a gut-wrenching ache, I thought only stupid goalkeeping. But after the fourth customary slap on the back from a teammate chortling, “Hope you never wanted kids, pal,” I thought only stupid, stupid testicles.

Natural selection has sculpted the mammalian forelimb into horses’ front legs, dolphins’ fins, bats’ wings, and my soccer ball-catching hands. Why, on the path from the primordial soup to us curious hairless apes, did evolution house the essential male reproductive organs in an exposed sac? It’s like a bank deciding against a vault and keeping its money in a tent on the sidewalk.

Some of you may be thinking that there is a simple answer: temperature. This arrangement evolved to keep them cool. I thought so, too, and assumed that a quick glimpse at the scientific literature would reveal the biological reasons and I’d move on. But what I found was that the small band of scientists who have dedicated their professional time to pondering the scrotum’s existence are starkly divided over this so-called cooling hypothesis.

Reams of data show that scrotal sperm factories, including our own, work best a few degrees below core body temperature. The problem is, this doesn’t prove cooling was the reason that testicles originally descended. It’s a straight-up chicken-and-egg situation—did testicles leave the kitchen because they couldn’t stand the heat, or do they work best in the cold because they had to leave the body?

Vital organs that work optimally at 98.5 degrees Fahrenheit get bony protection: My brain and liver are shielded by skull and ribs, and my girlfriend’s ovaries are defended by her pelvis. Forgoing skeletal protection is dangerous. Each year, thousands of men go to the hospital with ruptured testes or torsions caused by having this essential organ suspended chandelierlike on a flexible twine of tubes and cords. But having exposed testicles as an adult is not even the most dangerous aspect of our reproductive organs’ arrangement.

The developmental journey to the scrotum is treacherous. At eight weeks of development, a human fetus has two unisex structures that will become either testicles or ovaries. In girls, they don’t stray far from this starting point up by the kidneys. But in boys, the nascent gonads make a seven-week voyage across the abdomen on a pulley system of muscles and ligaments. They then sit for a few weeks before coordinated waves of muscular contractions force them out through the inguinal canal.

The complexity of this journey means that it frequently goes wrong. About 3 percent of male infants are born with undescended testicles, and although often this eventually self-corrects, it persists in 1 percent of 1-year-old boys and typically leads to infertility.

Excavating the inguinal canal also introduces a significant weakness in the abdominal wall, a passage through which internal organs can slip. In the United States, more than 600,000 surgeries are performed annually to repair inguinal hernias—the vast majority of them in men.

This increased risk of hernias and sterilizing mishaps seems hardly in keeping with the idea of evolution as survival of the fittest. Natural selection’s tagline reflects the importance of attributes that help keep creatures alive—not dying being an essential part of evolutionary success. How can a trait such as scrotality (to use the scientific term for possessing a scrotum), with all the obvious handicaps it confers, fit into this framework? Its story is certainly going to be less straightforward than the evolution of a cheetah’s leg muscles. Most investigators have tended to think that the advantages of this curious anatomical arrangement must come in the shape of improved fertility. But this is far from proven.

When considering any evolved characteristic, good first questions are who has it and who had it first. In birds, reptiles, fish, and amphibians, male gonads are internal. The scrotum is a curiosity unique to mammals. A recent testicle’s-eye view of the mammalian family tree revealed that the monumental descent occurred pretty early in mammalian evolution. And what’s more, the scrotum was so important that it evolved twice.

The first mammals lived about 220 million years ago. The most primitive living mammals are the duck-billed platypus and its ilk—creatures with key mammalian features such as warm blood, fur, and lactation (the platypus kind of sweats milk rather than having tidy nipples), although they still lay eggs like the ancestors they share with reptiles. Platypus testicles, and almost certainly those of all early mammals, sit right where they start life, safely tucked by the kidneys.

About 70 million years later, marsupials evolved, and it is on this branch of the family tree that we find the first owner of a scrotum. Nearly all marsupials today have scrotums, and so logically the common ancestor of kangaroos, koalas, and Tasmanian devils had the first. Marsupials evolved their scrotum independently from us placental mammals, which is known thanks to a host of technical reasons, the most convincing of which is that it’s back-to-front. Marsupials’ testicles hang in front of their penises.

Fifty million years after the marsupial split is the major fork in the mammalian tree, scrotally speaking. Take a left and you will encounter elephants, mammoths, aardvarks, manatees, and groups of African shrew- and mole-like creatures. But you will never see a scrotum—all of these placental animals, like platypuses, retain their gonads close to their kidneys.

However, take a right, to the human side of the tree, at this 100 million-year-old juncture and you’ll find descended testicles everywhere. Whatever they’re for, scrotums bounce along between the hind limbs of cats, dogs, horses, bears, camels, sheep, and pigs. And, of course, we and all our primate brethren have them. This means that at the base of this branch is the second mammal to independently concoct scrotality—the one to whom we owe thanks for our dangling parts being, surely correctly, behind the penis.

Between these branches, however, is where it gets interesting, for there are numerous groups, our descended but ascrotal cousins, whose testes drop down away from the kidneys but don’t exit the abdomen. Almost certainly, these animals evolved from ancestors whose testes were external, which means at some point they backtracked on scrotality, evolving anew gonads inside the abdomen. They are a ragtag bunch including hedgehogs, moles, rhinos and tapirs, hippopotamuses, dolphins and whales, some seals and walruses, and scaly anteaters.

For mammals that returned to the water, tucking everything back up inside seems only sensible; a dangling scrotum isn’t hydrodynamic and would be an easy snack for fish attacking from below. I say snack, but the world record-holders, right whales, have testicles that tip the scales at more than 1,000 pounds apiece. The trickier question, which may well be essential for understanding its function, is why did the scrotal sac lose its magic for terrestrial hedgehogs, rhinos, and scaly anteaters?

The scientific search to explain the scrotum’s raison d’être began in England in the 1890s at Cambridge University. Joseph Griffiths, using terriers as his unfortunate subjects, pushed their testicles back into their abdomens and sutured them there. As little as a week later, he found that the testes had degenerated, the tubules where sperm production occurs had constricted, and sperm were virtually absent. He put this down to the higher temperature of the abdomen, and the cooling hypothesis was born.

In the 1920s, a time when Darwin’s ideas were rapidly spreading, Carl Moore at the University of Chicago argued that after mammals had transitioned from cold- to warm-blooded, keeping the body in the mid-to-high 90 degrees must have severely hampered sperm production, and the first males to cool things off with a scrotum became the more successful breeders.

Heat disrupts sperm production so effectively that biology textbooks and medical tracts alike give cooling as the reason for the scrotum. The problem is many biologists who seriously think about animal evolution are unhappy with this. Opponents say that testicles function optimally at cooler temperatures because they evolved this trait after their exile.

If mammals became warm-blooded 220 million or so years ago, it would mean mammals carried their gonads internally for more than 100 million years before the scrotum made its bow. The two events were hardly tightly coupled.

The hypothesis’ biggest problem, though, is all the sacless branches on the family tree. Regardless of their testicular arrangements, all mammals have elevated core temperatures. If numerous mammals lack a scrotum, there is nothing fundamentally incompatible with making sperm at high temperatures. Elephants have a higher core temperature than gorillas and most marsupials. And beyond mammals it gets worse: Birds, the only other warm-blooded animals, have internal testes despite having core temperatures that in some species run to 108 degrees.

Any argument for why cooling would be better for sperm has to say exactly why. The idea that a little less heat might keep sperm DNA from mutating has been proposed, and recently it’s been suggested that keeping sperm cool may allow the warmth of a vagina to act as an extra activating signal. But these ideas still fail to surmount the main objections to the cooling hypothesis.

Michael Bedford of Cornell Medical College is no fan of the cooling hypothesis applied to testicles, but he does wonder whether having a cooled epididymis, the tube where sperm sit after leaving their testicular birthplace, might be important. (Sperm are impotent on exiting the testes and need a few final modifications while in the epididymis.) Bedford has noted that some animals with abdominal testes have extended their epididymis to just below the skin, and that some furry scrotums have a bald patch for heat loss directly above this storage tube. But if having a cool epididymis is the main goal, why throw the testicles out with it?

Another proposal for how the scrotum generates better sperm is that the scrotal sac serves as a school of hard knocks. Scott Freeman of the University of Washington hypothesized that the scrotum’s poor blood supply keeps the testicles in an oxygen-starved environment and so toughens up the sperm. Deprived of oxygen, sperm might react like “muscle cells to aerobic training,” increasing the number and size of mitochondria they contain and therefore becoming better prepared for the herculean task of ascending a cervix, uterus, and fallopian tube.

The main problem with the training hypothesis is that it was primarily concerned with the testicles’ lousy blood supply rather than their expulsion¾surely it would have been easier to evolve poor gonadal vasculature while keeping them in the body?

The alternative to scrotums benefiting sperm is that in some other way, despite their fragility, they actually benefit their owner. Such a notion was first presented in 1952 by a Swiss zoologist named Adolf Portmann after he’d presented the first major attack on the cooling hypothesis. What he proposed instead was the display hypothesis. Portmann argued that by placing the gonads on the outside, the male was giving a clear indication of his “reproductive pole,” a sexual signal important in intergender communication. Portmann’s best evidence was a few Old World monkeys who have brightly colored scrota.

This theory is not widely accepted because such conspicuous displays are rare (many scrotums are barely visible) and bright coloration seems to have evolved long after the original scrotum. Some have suggested it’s not surprising that in its 100 million-year existence, the scrotum has been co-opted as a sexual attractant by a handful of groups.

I was just about to discard the display hypothesis when two things happened. First, a colleague returned from her honeymoon in Tanzania excitedly showing anyone who’d look photos of a scrotum. The scrotum belonged, don’t worry, to one of Portmann’s Old World monkeys, a vervet monkey, and it was screamingly, beguilingly bright blue.*

OK, it’s just one monkey, I thought, but then I met Richard Dawkins. I had three minutes with the esteemed evolutionary biologist at a book signing, so I asked him for his opinions on the scrotum. After expressing severe doubt about the cooling hypothesis, he said he wondered whether it might have something to do with evolutionary biology’s handicap principle.

Handicap theory posits that if a female had to choose between two suitors who had beaten out all other competitors, but one had done so with a hand tied behind his back, she’d go for him because he’s obviously tougher still. It is controversial, but it does offer explanations for a number of problematic biological phenomena, such as male birds’ colorful plumage and songs that should attract predators. If the handicap theory is right, the scrotum exists to let its possessor say, “I’m so able to look after myself, I can keep these on the outside!”

In the mid-1990s, Michael Chance, a professor of animal behavior at the U.K.’s University of Birmingham, came across a newspaper story about the Oxford-Cambridge University boat race that piqued his interest in testicles. He learned that after the race, the rowers’ urine contained fluid from their prostates.

The oarsmen’s exertions, the cyclic abdominal straining, had deposited prostatic fluid in their urethras because there are no sphincters in the reproductive tract. Without such valves, squeezing of any of the sacs and tubes that make up this system is liable to empty it, or at least rearrange its contents. In 1996, in what has become known as the galloping hypothesis, Chance argued that externalization of the testes was necessary when mammals started to move in ways that sharply increased abdominal pressure.

A survey of how mammals move reveals a good deal of variety. And when Chance listed animals with internal testicles, he didn’t find many gallopers. The elephants, aardvarks, and their cousins on the undescended branch of the mammalian tree don’t bound or jump around. On the other side, the creatures such as moles and hedgehogs that reabsorbed their sexual cargo seem to have evolved away from internally disruptive types of movement. Among mammals that have returned to the sea, the few that have retained scrotums are the only ones who breed on land, such as elephant seals, who fight vigorously to defend their territory during rutting season.

One might argue that evolution could surely have thrown in a sphincter or two, or some internal shielding, but besides the possibility that the mechanics of ejaculation would struggle with such things, another argument supports Chance’s thinking. In 1991 Roland Frey of Germany’s Freiburg University reported a number of features of blood vessels of scrotal testes that ensure more constant pressure, possibly to avoid impaired blood drainage during galloping. The specific adaptations are different between marsupials and the rest of us but seem aimed at the same goal.

The galloping hypothesis would be a case of evolutionary compromise—the dangers of scrotality being a necessary price for the greater advantages of a new and valuable type of movement.

There are many theories in evolutionary biology. Often there’s great pleasure in the detectivelike process of piecing together the available, incomplete evidence into a coherent story, but the big challenge for this science is actually testing these ideas. One exciting recent development that might provide relevant evolutionary data has been the identification of the signal that controls the testicles’ initial descent from the kidney region to the undercarriage.

When the testes and ovaries are young, they are held in place by the so-called cranial suspensory ligament, while holding on loosely is a second, measly ligament termed the gubernaculum. To begin their roller-coaster ride, testicles secrete a signal that causes the suspensory ligament to degenerate and the gubernaculum to grow capable of dragging them to the base of the abdomen.

To study the evolution of this signal, a molecule related to insulin, Teddy Hsu and colleagues at Stanford University turned to the duck-billed platypus. They found that the platypus has a single gene for the prototype version of the signal, and that it was this gene’s duplication in subsequent mammals that allowed one version to evolve a function in testicular descent and the other in nipple development.

It’s a beautiful example of a genetic event in biological history that produced mammalian specialization. However, elephants and their nondescended cousins all have the duplicated genes, so the story’s not complete. A crucial next step will be determining the genes required for forming the inguinal canal and making the scrotum. Probably the best place to look will be in those mammals that have backtracked on externalization, where these genes have likely changed.

It’s rather humbling to realize that this basic aspect of our bodies remains a mystery. The fact that such a ridiculous appendage evolved twice surely means we should be able to get a handle on it. A successful theory will have to explain the full diversity of mammalian testicle positions, not just the scrotum’s existence. I like Chance and Frey’s galloping hypothesis, but could a scrotum really be the only way to deal with undulating abdominal pressure? In addition, do scrotal sperm really differ fundamentally from internally generated tiddlers? Can we definitively prove temperature sensitivity evolved after the expulsion of the scrotum? And signaling is still an outside bet, but if scrotums were really sexually selected, where’s the mammalian peacock, some species toting a pair of soccer balls?

Talking of which, while we wait for a final answer, the scrotality totality, us soccer goalkeepers should probably look to our baseball-playing friends who use evolution’s gift of a large brain and opposable thumbs to don a protective cup.

Correction, July 9, 2013: This article originally misspelled the name of the vervet monkey.