Step inside the mind of a killer. In what may seem like a cruel act in nature, males of certain mammal species are sometimes driven to kill babies of their own species. The main culprit, biologists think, is the species' social structure and reproductive strategy. Looking across hundreds of species, infanticide is more common in mammals when a few males must compete to reproduce with several females.

Across the animal kingdom, infanticide has been observed in totally disparate mammal species, from dolphins to lions to baboons. Since it was first witnessed in the wild, researchers have come up with a variety of explanations as to why males might kill infants of their own species. The newborns could be seen as exploiting or competing for resources. Some experts even suggested that it might be purely pathological, but with a clear gain for the killer (in reproductive success), that theory has largely been kicked to the curb. Most researchers instead agree that “infanticide can be an evolved reproductive strategy in males, and sometimes females as well,” says Sarah Hrdy, an anthropologist at the University of California at Davis, who first proposed the idea in the 1970s.

Still, teasing out the intricacies of why it evolved in some mammals and not others has been tricky. Dieter Lukas, a zoologist at the University of Cambridge, and his colleague Elise Huchard, a behavioral ecologist at the French National Centre for Scientific Research, wanted to see if they could find a common denominator for infanticide and its consequences. They looked at observational studies of 260 species in total—119 that practice infanticide and 141 that don't—and only included observations where the kill was confirmed and the killer was clearly male.

After comparing different factors related to social structure and mating behavior, a pattern emerged. Males committed infanticide more frequently in species where males and females lived together and a few males dominated as mates—but only remained at the top of the pack for brief periods of time. The practice was also associated with non-annual or seasonal reproduction cycles, meaning females could mate whenever. Through infanticide, males can eliminate the offspring of their competition and get the female back to full baby-making capacity faster, the team reports in a study published today in Science.

“Infanticide is probably the most extreme manifestation of sexual conflict in mammals, with a major fitness cost for mothers who lose their offspring, in which they have already invested lots of time and energy,” says Huchard. So females have evolved counter-strategies. One of those strategies might be monogamy, as a study in the Proceedings of the National Academy of Sciences suggested last year. But Lukas and Huchard found that females seem to do just the opposite to prevent a baby’s murder. Across the same swath of species, the researchers examined the frequency of infanticide against testes size. That's a proxy for female promiscuity, because the more promiscuous the females, the more sperm the male needs to ensure mating success. Species with larger testes had evolved infanticidal behavior earlier on in their family tree. A male lion or monkey can’t exactly demand a paternity test, so it makes sense: If a male thinks the baby is his, he’s less likely to kill it.

“Selection for larger testicles, which [the authors] describe in their paper, is a male counter-strategy to that female counter-strategy, which gives you an idea of how dynamic and complicated evolution of reproductive strategies can be,” says Hrdy, who was not affiliated with the study. “We cannot understand what one sex is doing without also taking into account what has been going on in the other.”

Plenty of females commit infanticide, too. Earlier this year, a female sloth bear at the National Zoo shockingly ate two cubs—perhaps because she could sense they were ill. “It may sound harsh, but the strategy is for the mother to favor her own survival and thus have at least a chance of breeding under more favorable circumstances in the future,” explains Leslie Digby, an evolutionary anthropologist at Duke University.

Then there are females who kill the offspring of rivals, probably to give their own kids a better shot at survival with either more resources or more protection from a male father figure. Some females might have a counter-strategy for that as well. Take banded mongooses—subordinate females have their litters on the same day as dominant females. All the newborns live in the same burrow, so the dominant female doesn’t know which kids to kill.

The next step for Lukas and Huchard will be to examine the evolutionary underpinnings of female baby-killers across mammal species. Overall, Lukas adds, the work highlights how social interactions can be powerful drivers of evolution. “Even with something like this very aggressive behavior, if the social circumstances change, the male will not kill the offspring,” he says. “We always think about evolution as adapting to the environment. We sometimes tend to forget how other individuals are actually a massive part of our environment.”