Sexually transmitted infections (STIs) can range from little-known conditions that present few symptoms through to dangerous viruses that we should definitely take steps to avoid.

Our awareness of STIs and the risks they pose is something that ends up having an impact on our sexual behaviour, and now a new study suggests that this phenomenon might have even been responsible for turning earlier humans into monogamists.

Scientists in Canada say the spread of STIs could explain the shift from polygynous mating among prehistoric humans – where men had multiple long-term partners – to a more restrained, monogamous society, where social norms compelled males to keep themselves to one partner to avoid transmitting disease.

"This research shows how events in natural systems, such as the spread of contagious diseases, can strongly influence the development of social norms and in particular our group-oriented judgments," said mathematician Chris Bauch from the University of Waterloo. "Our research illustrates how mathematical models are not only used to predict the future, but also to understand the past."

The researchers think that polygynous behaviour might have made sense for early hunter-gatherer societies living in small groups, as it could have enabled prehistoric men to maximise their chances of having offspring by mating with as many females as possible. But as humanity evolved into larger, agriculturalist populations of up to around 300 in number, the risk of STIs signalled an end to the party.

Using computers to simulate mating behaviours in conjunction with disease transmission parameters over the course of 30,000 years, the team found that when populations become larger than small hunter-gatherer groups of 30 or so, the social dynamic changes. This is due to the threat of STIs – which can negatively impact fertility – encouraging the group to punish risk-takers who didn't conform to safer, monogamous practices.

"In the absence of modern interventions such as antibiotics, latex condoms or contact tracing, bacterial STIs such as syphilis, chlamydia and gonorrhoea can cause very high rates of infertility and thus major demographic impacts," the authors write in Nature Communications. "Therefore, we speculate that STI-imposed selective pressures on our ancestors could have been even larger."

The researchers acknowledge that without further evidence of actual bacterial STI prevalence in hunter-gatherer and agriculturalist groups, it's impossible to know whether their hypothesis is correct, but suggest it presents "a potential pathway that might help explain the emergence… of socially imposed monogamy".

"Our social norms did not develop in complete isolation from what was happening in our natural environment. On the contrary, we can't understand social norms without understanding their origins in our natural environment," said Bauch. "Our social norms were shaped by our natural environment. In turn, the environment is shaped by our social norms, as we are increasingly recognising."