On Barro Colorado Island, in the middle of the Panama Canal, a population of metallic-green sweat bees is divided. Half the breeding females live socially, as queens reigning over one or two worker daughters in nests burrowed into twigs. The other half live alone, and raise young that quickly leave the nest. Social queens rear more daughters, while solitaries have more sons. The skewed sex ratio, reported recently in Biology Letters, supports a classic prediction related to the theory of kin selection, and may point to the origins of social behavior in insects.

Darwin himself wondered about bees, calling insect societies “one special difficulty” in The Origin of Species. Hives of celibate worker females foregoing reproduction to serve the queen didn’t fit Darwin’s thesis that individuals compete to mate and pass their heritable traits into the next generation. It would be another hundred years before evolutionary biologist W.D. Hamilton formalized a theory explaining altruism. Seemingly selfless behaviors evolve when actor and recipient are closely related, he suggested, sharing genes the beneficiary will pass into the next generation. “Kin selection does seem to explain the vast majority of helpers,” says social insect biologist Miriam Richards of Brock University in Ontario, Canada. “In almost all the societies where you see this behavior, they turn out to be relatives.”

Social insects offer compelling evidence for kin selection because of their unusual genetics, and because females control whether they have daughters or sons. Mother bees store sperm after mating, selectively releasing it to their eggs. Fertilized eggs make daughters (with two sets of chromosomes); unfertilized eggs become sons (with one set). Mothers are equally related to sons and daughters (50 percent each), but daughters share more genes with their sisters (75 percent) than with their mother, brothers (25 percent), or potential offspring (50 percent).

From a daughter bee’s perspective then, helping her mother raise more sisters offers the biggest genetic payoff. “It’s a better deal to be an altruist than to reproduce on your own,” says behavioral ecologist Adam Smith of George Washington University in Washington D.C., who led the new study.

For this reason, a now-classic 1976 paper by evolutionary biologist Robert Trivers and Hope Hare predicted that mother bees ruling social nests should skew their reproduction to make more females, incentivizing daughters to stick around and help. The logic follows, Trivers and Hare saw, that in a mixed population like Barro Colorado’s, with both social and solitary bees, solitary females should have more sons, to mate with the many daughters produced by social nests.

A generation of evolutionary biologists grew up on the skewed sex-ratio hypothesis, citing it more than 1,400 times in the last 40 years. Nobody field-tested it in a mixed population until Smith.

That wasn’t his original plan. Smith ventured to Barro Colorado to investigate the ecology and physiology of the island’s night-flying green bees, and he collected hundreds of tunneled-out-stick nests, counting the number of sons and daughters from each. “After doing this long enough,” he says, “we realized we had interesting data about sex ratios.” Over six years, his team found 371 social nests with 631 female offspring and 508 males (a female-to-male ratio of 1.24), and 605 solitary nests with 511 females and 852 males (a female-to-male ratio of 0.6). “The social ones are always producing more females than the solitary ones,” Smith explains. “And that is exactly as was predicted in this 1976 paper.”

Testing the prediction took 40 years because mixed bee populations are rare, the researchers say. Most species are solitary, which seems to be the ancestral character in bees, Richards says. A few evolved sociality, which in its early stages probably looked like a mix of hives and solo nests in a single population, as on Barro Colorado today. “It’s something we think probably always happens in social evolution,” she explains, “but most of the time we’re looking too late in the process, 80 million years down the line.”

If the green bees of the Panama Canal represent an early stage in the evolution of insect sociality, their female-biased social nests would set the stage for kin selection as the driver of evolving cooperation. But there’s no telling for sure. Queens could bias their sex ratios for any number of reasons, besides the interests of their relatives. This latest finding is consistent with kin selection, Smith says, but won’t settle any longstanding debates about the validity of that theory.

Robert Trivers, for one, now 76 and retired from teaching, is thrilled to see his prediction borne out. “It’s a joy 40 years later,” he says, “to see, my God, someone finally did the work.”