Something about cyclists seems to provoke fury in other road users. If you doubt this, try a search for the word "cyclist" on Twitter. As I write this one of the latest tweets is this: "Had enough of cyclists today! Just wanna ram them with my car." This kind of sentiment would get people locked up if directed against an ethnic minority or religion, but it seems to be fair game, in many people's minds, when directed against cyclists. Why all the rage?

I've got a theory, of course. It's not because cyclists are annoying. It isn't even because we have a selective memory for that one stand-out annoying cyclist over the hundreds of boring, non-annoying ones (although that probably is a factor). No, my theory is that motorists hate cyclists because they think they offend the moral order.

Driving is a very moral activity – there are rules of the road, both legal and informal, and there are good and bad drivers. The whole intricate dance of the rush-hour junction only works because people know the rules and by-and-large follow them: keeping in lane; indicating properly; first her turn, now mine, now yours. Then along come cyclists, innocently following what they see are the rules of the road, but doing things that drivers aren't allowed to: overtaking queues of cars, moving at well below the speed limit or undertaking on the inside.

You could argue that driving is like so much of social life, it’s a game of coordination where we have to rely on each other to do the right thing. And like all games, there's an incentive to cheat. If everyone else is taking their turn, you can jump the queue. If everyone else is paying their taxes you can dodge them, and you'll still get all the benefits of roads and police.

In economics and evolution this is known as the "free rider problem"; if you create a common benefit – like taxes or orderly roads – what's to stop some people reaping the benefit without paying their dues? The free rider problem creates a paradox for those who study evolution, because in a world of selfish genes it appears to make cooperation unlikely. Even if a bunch of selfish individuals (or genes) recognise the benefit of coming together to co-operate with each other, once the collective good has been created it is rational, in a sense, for everyone to start trying to freeload off the collective. This makes any cooperation prone to collapse. In small societies you can rely on cooperating with your friends, or kin, but as a society grows the problem of free-riding looms larger and larger.

Social collapse

Humans seem to have evolved one way of enforcing order onto potentially chaotic social arrangements. This is known as "altruistic punishment", a term used by Ernst Fehr and Simon Gachter in a landmark paper published in 2002. An altruistic punishment is a punishment that costs you as an individual, but doesn't bring any direct benefit. As an example, imagine I'm at a football match and I see someone climb in without buying a ticket. I could sit and enjoy the game (at no cost to myself), or I could try to find security to have the guy thrown out (at the cost of missing some of the game). That would be altruistic punishment.

Altruistic punishment, Fehr and Gachter reasoned, might just be the spark that makes groups of unrelated strangers co-operate. To test this they created a co-operation game played by constantly shifting groups of volunteers, who never meet – they played the game from a computer in a private booth. The volunteers played for real money, which they knew they would take away at the end of the experiment. On each round of the game each player received 20 credits, and could choose to contribute up to this amount to a group project. After everyone had chipped in (or not), everybody (regardless of investment) got 40% of the collective pot.

Under the rules of the game, the best collective outcome would be if everyone put in all their credits, and then each player would get back more than they put in. But the best outcome for each individual was to free ride – to keep their original 20 credits, and also get the 40% of what everybody else put in. Of course, if everybody did this then that would be 40% of nothing.

In this scenario what happened looked like a textbook case of the kind of social collapse the free rider problem warns of. On each successive turn of the game, the average amount contributed by players went down and down. Everybody realised that they could get the benefit of the collective pot without the cost of contributing. Even those who started out contributing a large proportion of their credits soon found out that not everybody else was doing the same. And once you see this it's easy to stop chipping in yourself – nobody wants to be the sucker.

Rage against the machine

A simple addition to the rules reversed this collapse of co-operation, and that was the introduction of altruistic punishment. Fehr and Gachter allowed players to fine other players credits, at a cost to themselves. This is true altruistic punishment because the groups change after each round, and the players are anonymous. There may have been no direct benefit to fining other players, but players fined often and they fined hard – and, as you'd expect, they chose to fine other players who hadn't chipped in on that round. The effect on cooperation was electric. With altruistic punishment, the average amount each player contributed rose and rose, instead of declining. The fine system allowed cooperation between groups of strangers who wouldn't meet again, overcoming the challenge of the free rider problem.

How does this relate to why motorists hate cyclists? The key is in a detail from that classic 2002 paper. Did the players in this game sit there calmly calculating the odds, running game theory scenarios in their heads and reasoning about cost/benefit ratios? No, that wasn't the immediate reason people fined players. They dished out fines because they were mad as hell. Fehr and Gachter, like the good behavioural experimenters they are, made sure to measure exactly how mad that was, by asking players to rate their anger on a scale of one to seven in reaction to various scenarios. When players were confronted with a free-rider, almost everyone put themselves at the upper end of the anger scale. Fehr and Gachter describe these emotions as a “proximate mechanism”. This means that evolution has built into the human mind a hatred of free-riders and cheaters, which activates anger when we confront people acting like this – and it is this anger which prompts altruistic punishment. In this way, the emotion is evolution's way of getting us to overcome our short-term self-interest and encourage collective social life.

So now we can see why there is an evolutionary pressure pushing motorists towards hatred of cyclists. Deep within the human psyche, fostered there because it helps us co-ordinate with strangers and so build the global society that is a hallmark of our species, is an anger at people who break the rules, who take the benefits without contributing to the cost. And cyclists trigger this anger when they use the roads but don't follow the same rules as cars.

Now, cyclists reading this might think "but the rules aren't made for us – we're more vulnerable, discriminated against, we shouldn't have to follow the rules." Perhaps true, but irrelevant when other road-users perceive you as breaking rules they have to keep. Maybe the solution is to educate drivers that cyclists are playing an important role in a wider game of reducing traffic and pollution. Or maybe we should just all take it out on a more important class of free-riders, the tax-dodgers.

13/02 UPDATE: We've changed a sentence in the third paragraph that readers said implied all cyclists break rules. This was not the intended implication of the original line, and we thank the readers who pointed this out.

Do you agree with Tom? If you would like to comment on this article or anything else you have seen on Future, head over to our Facebook page or message us on Twitter.