One of the mysteries of human development is how we were able to create tight-knit civilizations and densely packed urban areas without plunging into utter anarchy. Smiting, researchers believed, might have helped with that. It’s been hypothesized that the development of religion, whether through “moralizing high gods” or “broad supernatural punishment” enforced a code of behavior that kept most people in line and obedient, allowing for the emergence of early complex civilizations.

But new research indicates it’s the other way around. Prosocial religious practices—which put the emphasize on behavior toward humans, not just sacrifices to the gods—don’t appear until civilizations are already complex. That suggests they’re not a cause of civilization, but rather a result of it. “It’s not the main driver of social complexity as some theories had predicted,” says Oxford anthropologist Harvey Whitehouse, one of the lead authors of the paper, which appears in the journal Nature.

The study relies on a global history database called Seshat, which contains information on political systems found in societies across 30 geographic regions around the world. The data, which spans 10,000 years of history, was gathered in consultation with expert historians and archaeologists.

For their research purposes, the team looked at four measurements of supernatural enforcement of morality in 414 societies alongside the development of 51 measure of complex social elements, like law codes.

Looking at the data, the researchers found that pro-social religions don’t seem to spread among populations until they are fairly advanced, reaching about 1 million members. That stands in contrast to the idea that vengeful gods, for example, were necessary for humans to get along. “To our surprise, our data strongly contradict this hypothesis,” Whitehouse says in the press release. “In almost every world region for which we have data, moralizing gods tended to follow, not precede, increases in social complexity.”

But that doesn’t mean those people didn’t have religion. The data also shows that doctrinal rituals—which existed to appease supernatural agents—preceded the concept of gods with lightning bolts often by hundreds of years. Those rituals, the team argues, acted as a social glue that helped form a collective identity. Belonging to a group and following its norms can be a powerful force. “Our results suggest that collective identities are more important to facilitate cooperation in societies than religious beliefs,” Whitehouse says.

Once societies reached a certain size, fears of blood rains, pestilence and hell became a new way to modify behavior, especially when one-time encounters between people become common, like purchasing a sheep from a stranger. “[E]ven if moralizing gods do not cause the evolution of complex societies, they may represent a cultural adaptation that is necessary to maintain cooperation in such societies once they have exceeded a certain size, perhaps owing to the need to subject diverse populations in multi-ethnic empires to a common higher-level power,” the authors write in the paper.

But the debate isn’t over. Historian Edward Slingerland of the University of British Columbia, not involved in the study, tells Marcus Woo at Scientific American that some of the data in Seshat is open to interpretation and needs to be more thoroughly vetted by subject experts. “I’m not saying the data is all wrong,” he says. “It’s just that we don’t know—and that, in a way, is just as bad because not knowing means you can’t take seriously the analysis.”

In a piece in The Conversation the authors say that understanding what happens to societies as they grow and adopt moralizing gods could help us understand how society may change as people abandon their faith in judgmental deities, a trend that is happening around the world.

As for Seshat, expect more research to be coming from the database soon. “Seshat allows researchers to analyze hundreds of variables relating to social complexity, religion, warfare, agriculture and other features of human culture and society that vary over time and space,” co-author explains Pieter François, also from Oxford, says in the release. “Now that the database is ready for analysis, we are poised to test a long list of theories about human history.”