Scientists who study child development know that kids can identify a dominant figure in a social situation from a young age. Less has been known about how children respond to that powerful personality, and how a child’s reaction to injustice might change over time.

Now European researchers have discovered that there is a defined “Robin Hood” stage in childhood. Through two experiments, whose findings were recently published in Developmental Psychology, a team of cognitive scientists, social scientists, and psychologists learned that kids tend to start standing up to power, in favor of creating a more egalitarian social structure, at around age five. By age eight, most kids push for social equality, rooting for the underdog, when they detect an imbalance of power.

In the first experiment, researchers from the French National Center for Scientific Research, working with colleagues at universities in France and Switzerland, asked 173 children to watch a puppet show that involved two characters in obvious social roles. One puppet was the “boss” who constantly forced his will on the subordinate puppet. At the end of the play, the children were asked to give out pieces of chocolate to the puppets. The youngest children, those aged three to four, almost always gave the chocolate to the dominant puppet. This was less true of 5-year-olds, however. As the children aged, their tendency to align themselves with power slowly shifted. The vast majority of 8-year-olds gave the sweets to the less powerful puppet.

The second experiment introduced money, a potent symbol of status, into the equation. This time children watched a play involving three puppets—one clear “boss” and two subordinates. The scientists then gave the powerful puppet and one subordinate three coins each, while the second subordinate received only one coin. The children were eventually asked to take a coin from one of the two puppets who had three coins and give it to the poorest one. Again, the younger children chose not to take any money from the dominant personality and instead took a coin from the subordinate who had three and gave to the other subordinate. The vast majority of older children did the opposite; they took a coin from the powerful puppet, protecting the resources of one subordinate while boosting those of the least fortunate one.

Some of the older children could explain their choices, for example saying that they chose one puppet because it was “more unlucky” than the other.

The study’s authors argued the younger children tended to side with the dominant character in the plays because they are still most dependent on parental authority figures. They may have also wanted to gain the dominant personality’s approval, or stay out of trouble with him, the researchers suggested. But between the ages of five and eight, children see social relationships as more complicated and nuanced. “Indeed, the older they are, and the more playfellows they have, the greater the need for the notion of equality if they are to evolve within their group,” the researchers said.