Humans didn’t invent their sense of fairness overnight — in a new study published in Science, researchers from Emory University and Georgia State conclude that it was an evolutionary process with the aim of fostering long-term cooperation.

Scientists still don’t completely understand where the social idea of fairness came from. A previous study claimed that fairness was a recent cultural phenomenon rather than biological, something that happened when humans began treating strangers the same way they treat their mates or kin: with fairness and kindness. This all led to social cooperation: ties between non-relatives that eventually created tribes, city-states, and nations. And, naturally, this sense of fairness among individuals could be explained by the fact that more selfless, cooperative groups appeared to fare better than selfish ones. Scientists saw this as an evolutionary step forward of sorts.

Sometimes studying our distant primate relatives can help us understand ourselves in simpler terms. This is what Dr. Frans de Waal of the Yerkes National Primate Research Center and the Psychology Department at Emory University, and Dr. Sarah Brosnan of Georgia State’s departments of Psychology and Philosophy, sought to do in their recent study in order to better examine this idea of fairness: they performed an experiment on brown capuchin monkeys to see whether one would become dissatisfied if its partner received a greater benefit for completing the same task.

“This sense of fairness is the basis of lots of things in human society, from wage discrimination to international politics,” Brosnan said in the press release. “What we’re interested in is why humans aren’t happy with what we have, even if it’s good enough, if someone else has more. What we hypothesize is that this matters because evolution is relative. If you are cooperating with someone who takes more of the benefits accrued, they will do better than you, at your expense. Therefore, we began to explore whether responses to inequity were common in other cooperative species.”

In the study, which can be viewed in the video below, the researchers had brown capuchin monkeys give scientists a rock as part of their task. In return, the monkeys either received a piece of a cucumber or a grape. Monkeys prefer grapes to cucumbers, so the monkey receiving the cucumber while watching its partner receive grapes in return for the same task grew agitated, throwing the cucumber back at the scientist and rattling the bars of its cage. This shows that other species distantly related to humans have a sense of fairness, but not one that is evolved and fine-tuned enough to actually implement social cooperation and equality.

“Giving up an outcome that benefits you in order to gain long-term benefits from the relationship requires not only an ability to think about the future, but also the self-control to turn down a reward,” Brosnan said in the press release. “These both require a lot of cognitive control.” They conclude that only a few species are able to make the leap toward the “evolution of fairness”; fortunately, humans are one of them — and their closest relatives, the apes, are as well.