Today’s most popular religions all have one thing in common: a focus on morality. But the gods didn’t always care whether you are a bad person. Researchers have long puzzled over when and why religions moved away from a singular focus on ritual and began to encourage traits such as self-discipline, restraint, and asceticism. Now, a new study proposes that the key to the rise of so-called moralizing religions was, of all things, more wealth.

The new study “is by far the most significant advance I’ve seen in a long time,” says Richard Sosis, an anthropologist who studies the evolution of religion at the University of Connecticut, Storrs. “They’re offering what I think is a really novel theory to address this long-standing problem in the study of religion.”

Religion wasn’t always based on morality, explains Nicolas Baumard, a psychologist at the École Normale Supérieure in Paris. For the first several thousand years of human recorded history, he notes, religions were based on rituals and short-term rewards. If you wanted rain or a good harvest, for example, you made the necessary sacrifices to the right gods. But between approximately 500 B.C.E. and 300 B.C.E., a radical change appeared all over Eurasia as new religions sprung up from Greece to India to China. All of these religions shared a focus on morality, self-discipline, and asceticism, Baumard says. Eventually these new religions, such as Stoicism, Jainism, and Buddhism, and their immediate successors, including Christianity and Islam, spread around the globe and became the world religions of today. Back in 1947, German philosopher Karl Jaspers dubbed the pivotal time when these new religions arose “the Axial Age.”

So what changed? Baumard and his colleagues propose one simple reason: People got rich. Psychologists have shown that when people have fewer resources at their disposal, prioritizing rewards in the here and now is the best strategy. Saving for the future—much less the afterlife—isn’t the best use of your time when you are trying to find enough to eat today. But when you become more affluent, thinking about the future starts to make sense, and people begin to forgo immediate rewards in order to prioritize long-term goals.

Not coincidentally, the values fostered by affluence, such as self-discipline and short-term sacrifice, are exactly the ones promoted by moralizing religions, which emphasize selflessness and compassion, Baumard says. Once people’s worldly needs were met, religion could afford to shift its focus away from material rewards in the present and toward spiritual rewards in the afterlife. Perhaps once enough people in a given society had made the psychological shift to long-term planning, moralizing religions arose to reflect those new values. “Affluence changed people’s psychology and, in turn, it changed their religion,” Baumard says.

To test that hypothesis, Baumard and his colleagues gathered historical and archaeological data on many different societies across Eurasia in the Axial Age and tracked when and where various moralizing religions emerged. Then they used that data to build a model that predicted how likely it was that a moralizing religion would appear in all sorts of different societies—big or small, rich or poor, primitive or politically complex.

It turned out that one of the best predictors of the emergence of a moralizing religion was a measure of affluence known as “energy capture,” or the amount of calories available as food, fuel, and resources per day to each person in a given society. In cultures where people had access to fewer than 20,000 kilocalories a day, moralizing religions almost never emerged. But when societies crossed that 20,000 kilocalorie threshold, moralizing religions became much more likely, the team reports online today in Current Biology. “You need to have more in order to be able to want to have less,” Baumard says.

Some religious studies scholars are skeptical, however. “It’s an interesting hypothesis” that deserves to be investigated, allows Edward Slingerland, a historian who studies religion in ancient China at the University of British Columbia, Vancouver, in Canada. But when it comes to the transition from ritual religions to moralizing religions, the authors drew on outdated ideas, he says. For example, religion scholars now doubt that this change took place entirely during the narrow window of the Axial Age. “In early China, a lot of the moralizing stuff is arguably earlier than that,” whereas in the Arabian Peninsula it didn’t appear until about the 7th century C.E., Slingerland notes. He favors a hypothesis that has less to do with a certain fixed time period and more with the size and complexity of a given society; as people find themselves needing to cooperate with more and more strangers, belief in a high god encouraging morality helps smooth those new interactions and contributes to the overall success of the culture.

But both the political complexity and affluence hypotheses suffer from a lack of recent statistical data on religion, Slingerland says. The new paper should be “a call to arms for people who want to study history from a scientific perspective to start developing the tools we would need to do that,” says Slingerland, who is part of a team working on a database that aims to catalog the key features of religions around the world. “We’re only at the very beginning of being able to approach cultural history with any kind of rigor.”