Research suggests that belief in an angry and vengeful god may have brought ancient societies together.

A study published this week in Nature suggests religiosity may contribute to cooperation and collaboration between people, motivating them to be more charitable towards strangers outside their own family and community, especially if they have similar beliefs.

“People may trust in, cooperate with and interact fairly within wider social circles, partly because they believe that knowing gods will punish them if they do not,” the study's authors wrote.

“Moreover, the social radius within which people are willing to engage in behaviours that benefit others at a cost to themselves may enlarge as gods' powers to monitor and punish increase.”

Researchers studied 591 people from eight diverse communities in Brazil, Mauritius, Siberia, Tanzania, Fiji and Vanuatu, who between them subscribed to an array of religions including Christianity, Hinduism, Buddhism and local traditions such as animism and ancestor worship.

The participants played a game where they were given the option to exercise financially favour themselves and their local community, or roll a die that could mean giving money to a distant person of the same religion.

Each participant was also interviewed about their personal religious beliefs to gauge how much their god or gods cared about morality and punishment, and the gods’ knowledge of the participants’ behaviour.

The researchers found those who believed in a more punitive, all-knowing god were willing to give more money to distant people that share their same religious belief.

Lead author Dr Benjamin Purzycki says if someone believes their actions are monitored, judged and punished by a deity, they are more likely to play fair than to play favourites.

“Ultimately we've all got very similar constitutions; we behave a certain way when we feel like we're being watched and if there's a threat of a punisher around, that alters our behaviour,” said Dr Purzycki, post-doctoral research fellow at the Centre for Human Evolution, Cognition and Culture at the University of British Columbia.

“So what these gods seem to do is they harness that suite of psychological predispositions we have and it can steer our sociality and pro-sociality in specific ways.”

Dr Purzycki said people’s charity was tempered by the needs of their family.

“We found exactly what you would expect from a rational being where the more children people had the more likely they were to favour themselves and their local community at the expense of these geographically distant communities who shared the same religion beliefs and practices,” he said.

The authors suggest that religiosity may have helped ancient cultures expand their cooperation, trust and fairness to include far-flung strangers of similar religious persuasions.

Professor Dominic D P Johnson from the University of Oxford wrote an accompanying commentary that called the study “"he most explicit evidence yet that belief in supernatural punishment has been instrumental in boosting cooperation in human societies”.

He also noted that the study did not explore whether the influence of a vengeful god would extend fairness to individuals from different or no religious persuasion.