In more than 1,500 animal species, from crickets and sea urchins to bottlenose dolphins and bonobos, scientists have observed sexual encounters between members of the same sex.
Some researchers have proposed that this behavior has existed since the dawn of the animal kingdom. But the authors of a new study of thousands of mammalian species paint a different picture, arguing that same-sex sexual behavior evolved when mammals started living in social groups. Although the behavior does not produce offspring to carry on the animals’ genes, it could offer other evolutionary advantages, such as smoothing over conflicts, the researchers proposed.
“It may contribute to establishing and maintaining positive social relationships,” said José Gómez, an evolutionary biologist at the Experimental Station of Arid Zones in Almería, Spain, and an author of the new study.
But Dr. Gómez cautioned that the study, published on Tuesday in the journal Nature Communications, could not shed much light on sexual orientation in humans. “The type of same-sex sexual behavior we have used in our analysis is so different from that observed in humans that our study is unable to provide an explanation for its expression today,” he said.
Previous studies of same-sex sexual behavior have typically involved careful observations of a single species, or a small group of them. Dr. Gómez and his colleagues instead looked for the big evolutionary patterns that gave rise to the behavior in some species but not others.
The researchers surveyed the 6,649 species of living mammals that arose from reptilelike ancestors starting roughly 250 million years ago. Looking over the scientific literature, they noted which of them had been seen carrying out same-sex sexual behaviors — defined as anything from courtships and mating to forming long-term bonds.
The researchers ended up with a list of 261 species, or about 4 percent of all mammalian species, that exhibited these same-sex behaviors.
Males and females were about equally likely to be observed carrying out same-sex sexual behavior, the analysis showed. In some species, only one sex did. But in still others — including cheetahs and white-tailed deer — both males and females engaged in same-sex sexual behavior.
The researchers then investigated how the behavior arose in mammals. Looking at an evolutionary tree, they found that species engaging in it were scattered across the tree’s branches, suggesting that the behavior independently arose in each lineage.
“With the current data available, it seems that it has evolved multiple times,” Dr. Gómez said.
The researchers concluded that the earliest members of major groups of living mammals, such as primates or cats, probably didn’t engage in same-sex sexual behavior. As new lineages evolved, some of them started exhibiting the behavior.
Apes, for example, branched off from other primates about 25 million years ago. Since then, they evolved a much higher rate of same-sex sexual behavior than species on older branches of primates, such as lemurs.
Dr. Gómez and his colleagues then looked for traits that these same-sex branches had in common. A statistical analysis of the evolutionary tree revealed that they tended to be social species instead of solitary ones.
Paul Vasey, a primatologist at the University of Lethbridge in Canada who was not involved in the study, said that a number of researchers who have studied same-sex sexual behavior have hypothesized that the evolution of social groups had favored it. But they were looking at individual species, rather than across the tree of life.
“For anyone familiar with the literature, I don’t think it is a huge surprise to see that same-sex sexual behavior is related to sociality,” Dr. Vasey said. “It is nice to see this conclusion supported by the methods used by the authors.”
Living in a social group offers a lot of benefits to mammals, such as better protection from predators. But it also creates new challenges. Mammalian societies may form hierarchies, for example, in which top-ranking animals keep lower-ranking ones in line with violence. But these conflicts can cause a group to fracture, which is bad for everyone.
Dr. Gómez said that same-sex sexual behavior might be one of the ways that mammals can manage their unstable social worlds. It may be a way for mammals to form bonds and alliances, to reconcile after a fight or to divert aggression into courtship.
But Dieter Lukas, an evolutionary biologist at the Max Planck Institute for Evolutionary Anthropology in Leipzig, Germany, who was not involved in the new study, was skeptical of this conclusion. “Taken together, the findings in this study have not convinced me that there is a single explanation for the occurrence of same-sex behavior,” he said.
His skepticism came in part from the data on which the scientists based their study. The challenges of observing animals in the wild may mean that same-sex behavior in some species goes overlooked. “It will be much easier to observe whether the behavior occurs if individuals are on open ground and active during daytime,” Dr. Lukas said.
Marlene Zuk, an evolutionary biologist at the University of Minnesota who was not involved in the study, commended the researchers for focusing their study on mammals alone, rather than the entire animal kingdom. “We’re trying to steer way from one explanation to rule them all,” she said.
In April, Dr. Zuk and Jon Richardson, a postdoctoral researcher in her lab, put forward a different explanation for same-sex behavior based on an experiment on crickets. They showed that male crickets will sometimes produce courtship songs and try to mate with other males and with juveniles.
Since the crickets don’t live in social groups, that can’t explain the behavior Dr. Zuk and Dr. Richardson documented. Instead, crickets and perhaps many other species may engage in same-sex sexual behavior as part of a strategy to take advantage of as many opportunities to mate as possible.
Dr. Zuk likened the strategy to a smoke detector. “You want a smoke detector that is sensitive enough to detect all fires,” she said. “And if it does that, occasionally it’s going to go off when you burn your toast.”