A four-year-old girl sees three biscuits divided between a stuffed crocodile and a teddy bear. The crocodile gets two; the bear one. “Is that fair?” asks the experimenter. The girl solemnly judges that it is not. “How about now?” asks the experimenter, breaking the bear’s single biscuit in half. The girl cheers up: “Oh yes, now it’s fair. They both have two.” Strangely, children feel very strongly about fairness, even when they scarcely understand it.

Adults care about fairness too – but how much? One way to find out is by using the ultimatum game, created by economist Werner Guth. Jack is given a pile of money and proposes how it should be divided with Jill. Jill can accept Jack’s “ultimatum”, otherwise the deal is off, and neither gets anything.

Suppose Jack and Jill don’t care about fairness, just about accumulating cash. Then Jack can offer Jill as little as he likes and Jill will still accept. After all, a little money is more than no money. But imagine, instead, that Jack and Jill both care only about fairness and that the fairest outcome is equality. Then Jack would offer Jill half the money; and Jill wouldn’t accept otherwise.

What happens when we ask people to play this game for real? It turns out that people value fairness a lot. Anyone offered less than 20-30% of the money is likely to reject it (especially men with high levels of testosterone, it turns out). So people sacrifice hard cash to avoid unfair treatment. And receiving an unfair offers makes us feel sick, almost literally: brain scanning reveals that unfair offers trigger activity in a brain area (the anterior insula) activated by disgusting smells or images. Happily, most offers are pretty equitable; indeed, by far the most common is a 50-50 split.

Facebook Twitter Pinterest Is it fair that the crocodile gets more biscuits that the bear? Photograph: Adam Howling

But children, and adults, also care about a very different sort of (un)fairness, namely cheating – so much so that some evolutionary psychologists suggest we may be “wired” for cheater-detection. Think how many games of snakes and ladders have ended in acrimony when one child “accidentally” miscounts her moves and another child objects. But this sense of fairness isn’t about equality of outcome: games inevitably have winners and losers. Here, fairness is about playing by the rules.

Both types of fairness matter. Fairness-as-equality comes to the fore when we think about divisions of chores, favouritism between children or postcode lotteries in healthcare. Fairness-as-no-cheating is centre stage when we are outraged by professional fouls, drugs in sport, falsifying wills, miscarriages of justice or fraudulent elections.

So which is more important: equality or no-cheating? I think the answer is neither. I suspect that our brains are concerned about something deeper, from which our liking for equality and our hatred of cheating are mere side effects. An unlikely clue comes from considering, of all things, the national lottery. Like other lotteries, it certainly doesn’t make the world more equal: a few people get rich and most people get nothing. Nevertheless, we hope, it is fair – but what does this mean? The fairness-as-no-cheating viewpoint has a ready answer: a lottery is fair if it is conducted according to the “rules”. But which rules? None of us has the faintest idea, I suspect. Suppose that buried in the small print at lottery HQ is a rule that bars people with a particular surname (let’s say, Moriarty). So a Ms Moriarty could buy a ticket each week for years without any chance of success.

How would she react if she found out? Surely with outrage: how dare the organisers let her play, week after week, without mentioning that she couldn’t possibly win! She’d justifiably feel unfairly treated even though the lottery followed the rules to the letter, because these were rules she’d never have agreed to.

To protest against unfairness, then, is to make an accusation of bad faith. From this viewpoint, an even split between the crocodile and the bear seems fair because (normally, at least), it is the only split they would both agree to. But were the girl in our experiment to learn that the crocodile doesn’t like biscuits or that the bear isn’t hungry, I suspect she’d think it perfectly fair for one toy to take the lot. Inequality of biscuits (or anything else) isn’t necessarily unfair, if both parties are happy. And the unfairness of cheating stems from the same source: we’d never accept that someone else can unilaterally violate agreements that we have all signed up to, whether to follow the rules of snakes and ladders or not to take performance-enhancing drugs.

So perhaps the four-year-old’s intuitions about fairness is not the first stirrings of egalitarianism, but the beginnings of an understanding of negotiation. With a sense of fairness, people will have to make us decent offers (or we’ll reject their ultimatums) and stick by the (sensible) rules, or we’ll be on the warpath. So a sense of fairness is crucial to effective negotiation; and negotiation, over toys, treats, bedtimes, chores, money etc, is the fabric of life.