Rarely a day goes by without Twitter, Facebook or some other social media platform exploding in outrage at some perceived injustice or offence.

It could be aimed at a politician, celebrity or just some hapless individual who happened to make an off-colour joke or wear the wrong dress to their school formal.

These outbursts of outrage are not without cost for everyone involved. Many people, especially women and people from minority backgrounds, have received death threats for simply expressing themselves online. Many more people have chosen to censor themselves for fear of a backlash from an online mob. And when the mob does go after a perceived wrongdoer, all too often the punishment far exceeds the crime. Targeted individuals have been ostracised from their communities, sacked from their jobs, and in some cases taken their own lives.

How did we get here?

Social media was supposed to unite us. It was supposed to forge stronger social connections. It was meant to bridge conventional barriers like wealth, class, ethnicity or geography. It was supposed to be a platform where we could express ourselves freely. Where did it all go so horribly wrong?

It’s tempting to say that something must be broken, either the social media platforms or ourselves. But in fact, both are working as intended.

When it comes to the social media platforms, they and their owners thrive on the traffic generated by viral outrage. The feedback mechanisms – ‘like’ buttons, comments and sharing – only serve to amplify it. Studies have shown that posts expressing anger or outrage are shared at a significantly higher rate than more measured posts.

In short, outrage generates engagement, and for social media companies, engagement equals profit.

When it comes to us, it turns out that our minds are working as intended too. At least, working as evolution intended.

Our minds are wired for outrage.

It was one of the moral emotions that evolution furnished us with to keep people behaving nicely tens of thousands of years ago, along with other emotions like empathy, guilt and disgust.

We may not think of outrage as being a ‘moral’ emotion, but that’s just what it is. Outrage is effectively a special kind of anger that we feel when someone does something wrong to us or someone else, and it motivates us to punish the wrongdoer. It’s what we feel when someone pushes in front of us in a queue or defrauds an elderly couple of their life savings. It’s also what we feel just about any time we log on to Twitter and look at the hashtags that are doing the rounds.

Well before the advent of social media, outrage served our ancestors well. It helped to keep the peace in small-scale hunter-gatherer societies. When someone stole, cheated or bullied other members of their band, outrage inspired the victims and onlookers to respond. Its contagious nature spread word of the wrongdoing throughout the band, creating a coalition of the outraged that could confront the miscreant and punish them if necessary.

Outrage wasn’t just something that individuals experienced. It was built to be shared. It inspired ‘strategic action’, where a number of people – possibly the whole band – would threaten or punish the wrongdoer. A common punishment was social isolation or ostracism, which was often tantamount to a death sentence in a world where everyone depended on everyone else for their survival. The modern equivalent would be ‘cancelling’.

But take this tendency to get fired up at wrongdoing and drop it on social media, and you have a recipe for misery.

All our minds needed was a platform that could feed them a steady stream of injustice and offence and they quickly became addicted to it.

Another problem with social media is that many of the injustices we witness are far removed from us, and we have little or no power to prevent them or to reform the wrongdoers directly. But that doesn’t stop us trying. Because we are rarely able to engage with the wrongdoer face-to-face, we resort to more indirect means of punishment, such as getting them fired or cancelling them.

In small-scale societies, the intense interdependence of each individual on everyone else in the band meant there were good reasons to limit punishment to only what was necessary to keep people in line. Actually, following through with ostracism could remove a valuable member of the community. Often just the threat of ostracism was enough to prevent harmful behaviour.

Not so on social media. The online target is usually so far removed from the outraged mob that there is little or no cost for the mob if the target is extricated from their lives. The cost is low for the punishers but not necessarily for the punished.

Social media outrage isn’t only bad for the targets of the mob’s ire – it’s bad for the mob too. Unlike ancestral times, we now have access to an entire world of injustice about which to get outraged. We even have a word for the new tendency to seek out and overconsume bad news: doomscrolling. This can leave us with an impression that the world is filled with evil, corrupt and bad actors when, in fact, most people are genuinely decent.

And the mismatch between the unlimited scope of our perception, and the limited ability for us to genuinely effect change, can inspire despondency. This, in turn, can motivate us to seek out some way for us to recapture a sense of agency, even if that is limited to calling someone out on Twitter or sharing a dumb quote from a despised politician on Facebook. But what have we actually achieved, except to spread the outrage further?

The good news is that while we’re wired for outrage, and social media is built to exploit it, we are not slaves to our nature. We also evolved the ability to unshackle ourselves from the psychological baggage of our ancestors. That makes it possible for us to avoid the outrage trap.

If we care about making the world a better place – and saving ourselves and others from being constantly tired, angry and miserable – we can change the way we use social media. And this means we must change some of our habits.

It’s hard to resist outrage when we see it, like it’s hard to resist that cookie that you left on the kitchen counter. So put the cookie away. This doesn’t mean getting off social media entirely. But it does mean being careful about whom you follow. If the people you follow are only posting outrage porn, then you can choose to unfollow them. Follow people who share genuinely new or useful information instead. Replace the cookie with a piece of fruit.

And if you do come across something outrageous, you can decide what to do about it. Think about whether sharing it is going to actually fix the problem or whether you’re just seeking validation for your own feelings of fury.

Sometimes there are things we can share that will do good – there’s a role for increasing awareness of certain systemic injustices, as we’ve seen with the #metoo and Black Lives Matter movements. But if it’s just a tasteless joke, a political columnist trolling the opposition or someone who refuses to wear a mask at Bunnings, you can decide whether spreading it further is going to actually make things better. If not, don’t share it.

It’s not easy to inoculate ourselves against viral outrage. Our evolved moral minds have a powerful grip on our hearts. But if we want to genuinely combat injustice and harm, we need to take ownership of our behaviour and push back against outrage.