Shame is such a powerful and uncomfortable emotion that people might find it hard to believe that it's actually good for something. But, according to a new study, feelings of embarrassment and humiliation are in effect a kind of evolutionary survival mechanism.

An international team of researchers says that shame performs a vital role in maintaining our ties to the social fabric, much like other defence mechanisms that prohibit us from doing ourselves physical harm.

"The function of pain is to prevent us from damaging our own tissue," said evolutionary psychologist Daniel Sznycer from the University of California, Santa Barbara (UC Santa Barbara). "The function of shame is to prevent us from damaging our social relationships, or to motivate us to repair them."

According to the researchers, the power of shame to coerce us into behaving in certain 'acceptable' ways goes back to ancient human groupings when our inclusion in social life was crucial to our ongoing survival.

"Our ancestors lived in small, cooperative social groups that lived by hunting and gathering. In this world, your life depended on others valuing you enough to give you and your children food, protection, and care, " said one of the team, anthropologist John Tooby, also of UC Santa Barbara.

"The more you are valued by the individuals with whom you live – as a cooperative partner, potential mate, skilled hunter, formidable ally, trustworthy friend, helpful relative, dangerous enemy – the more weight they will put on your welfare in making decisions. You will be helped more and harmed less."

While such a system of checks and balances might not seem quite as dramatically vital in a modern world centuries removed from hunters and gatherers, shame in fact functions in pretty much the exact same way today. The researchers describe the process as a kind of internal map we each keep of which acts would trigger a devaluation of our reputation in the eyes of others. Keeping up appearances, in other words.

"What is key," said Sznycer, "is that life in our ancestors' world selected for a neural program – shame – that today makes you care about how much others value you, and motivates you to avoid or conceal things that would trigger negative reevaluations of you by others."

To measure how shame operates in a contemporary and cross-cultural context, the researchers conducted an experiment with around 900 participants across the US, India, and Israel. Participants were asked how they would feel in relation to a number of fictional scenarios involving behaviours that – from a longstanding, evolutionary perspective – could lead to devaluation. Such behaviours included stinginess, infidelity, and physical weakness, among others.

Participants in one group were asked how negatively they would view an individual if they exhibited one of these traits. Meanwhile, participants in another group rated how much shame they would personally feel if they exhibited the same behaviour.

The similarity between the objective and subjective results, reported in Proceedings of the National Academy of Sciences, suggest people's inherent sense of shame and what others would deem as unacceptable is a finely tuned emotional reaction.

"We observed a surprisingly close match between the negative reactions to people who commit each of these acts – that is, the magnitudes of devaluation – and the intensities of shame felt by individuals imagining that they would commit those acts," said Cosmides.

While it's the reaction of our local social groups that matters most to the individual, the researchers say that some of the traits they tested for – stinginess, lack of ambition, and infidelity – actually create strong 'universal' reactions that are not culturally specific, meaning the results across three countries pretty much matched up.

"The sheer magnitude of the shame match to foreign audiences is stunning," said Cosmides. "However, we think that shame is tuned specifically to local audiences: those whose support you need."

In other words, just because you're on holiday in another country doesn't mean you get any kind of pass on bad behaviour. When it comes to the fundamentals, shame knows no boundaries.