In 1598, a European miner working in the Bolivian highlands stumbled across a 10-year-old Andean girl who was still alive, despite having been walled up inside a funerary tower three days earlier. Several decades had passed since the Inca Empire—the most sophisticated in the world at that time—had fallen, but its practices lived on among the Incas’ descendants in the region, including human sacrifice. The practice held on a little longer after this incident. Around 20 years later, a boy, who had escaped from local chiefs attempting to bury him alive, took refuge in a Spanish community in the Peruvian Sierra. But the tradition was incompatible with the moral outlook of the new Catholic regime, and die it did, eventually.

The question scientists are debating now is: Did our modern world spring from the beliefs of those who buried the girl alive, or from those of the miner who freed her?

To put that question another way, were human societies able to grow so large and complex because cruel practices like human sacrifice shored them up, or because human sacrifice was abandoned in favor of other forms of social glue—notably, major religions like Christianity?

Human sacrifice is defined as the ritualized, religiously motivated killing of a human being. It is no longer sanctioned by any state, but it was once practiced by societies across the globe. Chiefs and priests routinely strangled, bludgeoned, drowned, and burned their victims to death in order to please various ancestors or deities. Invariably, those ordaining the sacrifices were of higher status than their victims, prompting researchers to ask whether the violence served a social purpose—namely, keeping the lower orders in line. “Social elites used human sacrifice as a tool to instill fear and show their power,” Joseph Watts of the Max Planck Institute for the Science of Human History in Jena, Germany, says. “As far as tools go, it was a pretty bloody and dramatic one.”

Though human sacrifice is a thing of the past, Watts and others believe that understanding what motivated it is still relevant because other manifestations of extreme inequality do persist—slavery, for example. If they could identify the purpose human sacrifice served, then perhaps they could propose more-humane ways of achieving that purpose, thereby making the world a better place.

The question of the social function of human sacrifice is not new, but until recently efforts to answer it have drawn purely on anecdotal evidence. For Harvey Whitehouse, an anthropologist at the University of Oxford, that approach is deeply flawed, because it allows researchers to cherry-pick the evidence that supports their pet theories. A better method, he says, is to pool data about large numbers of historical societies in databases, and test theories against them.

Watts and colleagues have built one such database, Pulotu, that stores information about more than 100 traditional Austronesian cultures. Whitehouse and others have developed Seshat—another database that covers more than 400 societies that existed across the globe over the last 10,000 years. “We’re trying to develop a whole new methodology that adjudicates more objectively between competing hypotheses,” says Whitehouse, “so that we end up with a more robust picture of the human past from which we can extract genuine lessons for the future.”

Over time, as societies became larger, they also tended to become less egalitarian and more hierarchical. In 2016, the Jena group reported that Pulotu data support the so-called social control theory, according to which human sacrifice stabilized societies as they became more stratified, by legitimating class distinctions and political authority. It is probably no coincidence, Watts says, that the victims were often people who posed a threat to the elites, or who had fallen out of favor with them.

The results coming out of Seshat—which have yet to be published—suggest that social control may not be the whole story, however. No society in Pulotu comprises more than a million people, while Seshat includes “mega-empires” whose subjects numbered in the tens of millions. Seshat’s founders therefore argue that it tracks social complexity closer to modern levels, and they find that, beyond around 100,000 people, human sacrifice becomes a destabilizing force. “Our suggestion is that this particularly pernicious form of inequality isn’t sustainable as societies get more complex,” says Whitehouse. “It disappears once they pass certain thresholds, because they cannot survive with that level of injustice.”

Rather than being an essential stepping stone to greater complexity, the Seshat team argues, at these thresholds human sacrifice became a parasitic practice—an attempt, often by military heroes who had transformed themselves into “god-kings,” to seize and maintain power, to the detriment of social cohesion. That’s because, whereas human sacrifice might have terrorized the members of a smaller, simpler society into obeying their self-styled leader, it could no longer do so in a large and ethnically diverse one. There, it was easier to disobey the ruler, or desert, and evade punishment—and the temptation to do so only grew stronger as societies grew larger.

According to Peter Turchin, another of Seshat’s founders, who studies cultural evolution at the University of Connecticut, this mattered because the survival of historical societies often depended on their military prowess. Those that were less united and hence weaker on the battlefield may have found themselves destroyed by, or absorbed into, militarily superior ones that had rejected human sacrifice, having found better ways of promoting social cohesion. The Spanish conquest of the Inca could be considered an example of the survival of the fittest society, in this sense.

But though sheer military might may have been the underlying cause of the disappearance of human sacrifice, the members of the victorious societies likely didn’t see it that way. They probably saw the rejection of human sacrifice as a logical extension of the golden rule, or as a religious imperative. The Harvard psychologist Steven Pinker has argued that societies became less violent as they became better at abstract reasoning. In other words, people spurned violence against others on the grounds that they wouldn’t want it done to them. Turchin and colleagues disagree: With staggering frequency, they argue, it was religion rather than reason that turned people away from ritualized brutality. But a different kind of religion—one that deified not a mortal god-king, but a supernatural “big god.” These were the forerunners of today’s major world religions, and those who spread them railed against human sacrifice. “They basically said, God is repelled by this,” says Turchin.

These new religions—such as Judaism and Zoroastrianism—were born roughly during the first millennium B.C., and though they have yet to prove it, the Seshat group suspects that they provided the social glue that allowed societies to reach newly intricate heights. Without these religions, the researchers think, the complexifying process would have stalled long before it produced the nation-states and multistate federations of today.

Neither the Seshat nor the Pulotu team claims to have solved the puzzle of human sacrifice, but together they feel they are building toward an answer. “The merit of these databases is that they change the nature of the conversation,” says the anthropologist Richard Sosis, also of the University of Connecticut, who studies the evolution of religion, and is not part of either team. “Now it is all about the data.”

Whitehouse thinks social evolution was driven by two opposing forces—persuasion and coercion. Persuasion might have taken the form of reassuring, nonviolent religious rituals, for example, and coercion the form of cruel diktats from a god-king. By statistically analyzing large amounts of cross-cultural data, researchers can start to explore which combinations of the two produced the most peaceful and prosperous societies in history, and then apply those lessons to the governance of modern societies. “What we can learn from the big patterns in global history is how successfully to give persuasion more of the upper hand,” Whitehouse says.

That prospect is some way off. But the big-data approach to history has already provided a fascinating glimpse into the roots of social complexity. To return to the case of the Andean girl rescued by the Spanish miner, the data suggest that the modern world sprang from belief systems like his—but that those systems might never have come to be if earlier peoples hadn’t buried children alive.