By preschool, lots of toddlers will proudly don superhero attire and fervently expound on the need to stand up to bullies, defeat villains, and fight for good and justice. It may seem like their sponge-like minds have sopped up every dribble of virtue from their parents, peers, and cartoons. But a new study suggests that their noble credos may actually be hardwired into their noggins long before they can recite the Spiderman theme song, babble ‘mama,’ or even roll over.

Infants as young as six-months old grasp the complex interactions between a bully, a victim, and an intervening protector—and they root for the brave protector, researchers report this week in Nature Human Behaviour.

Their ingrained support for heroic acts preceded even their understanding of what a hero is, the researchers found. In follow-up experiments, it was clear that the six-month-olds lacked the cognitive wherewithal to grasp intentions—something 10-month old babies seemed to get. That is, the younger babies seemed to understand that the protector helped the victim in the end—a good thing that the babies preferred. But they couldn’t tell the difference between an intentional act of heroism and an accidental one.

The authors of the study, led by researchers at Kyoto University, concluded that our fondness for heroic feats seems to go super deep. “Our admiration for and emphasis upon such acts—so prevalent in thousands of stories across human cultures—is rooted within the preverbal infant’s mind,” the researchers wrote.

Researchers have long known that our hero fandom starts young, but they didn’t know exactly how young. This is mostly because heroic acts, aka “protective third-party interventions,” are kind of complicated for budding minds to fully understand.

For instance, such an act could involve a gunman robbing poor Joe Schmo and a brave bystander stepping in to fight off the gunman. To fully interpret the situation, a child would first need to grasp that one character is oppressing the other—the gunman is mistreating Joe. Next, a child would have to understand that there are two different consequences to the bystander’s action—defeating the gunman and helping Joe. Last, the observant little one would need to either absorb the intention of the bystander or at least the end goals of safety and justice.

With a total of 132 infants, the researchers had groups watch a variety of cartoons and then express preferences. For easy-to-digest scenarios, the researchers created cartoons with simple shapes: two circles (the aggressor and the victim) and a square (the bystander). In one clip, the aggressor circle repeatedly rams into the victim circle while the bystander square watches nearby. At the end, the square gets in between the two circles and the aggressor backs off. In another clip, the aggressor and victim circles act the same, but the bystander square doesn’t get involved.

After watching both clips the babies had to choose between the hero bystander and the uninvolved bystander. The babies overwhelmingly went for the hero.

In subsequent experiments, the researchers tweaked the cartoons to make sure that the babies understood the power dynamics of the scenario and were picking the hero square because it stopped the oppression (and not because it just seemed to be more social).

Last, the researchers examined if the babies could grasp intention. They showed two clips: in one, the hero square dashed around trying to get to the aggressor and victim circles to intervene, succeeding only at the end (the intentional hero); in the other, the hero square stood still and didn’t do anything until the very end when it intervened and helped the victim circle (a successful, but maybe accidental hero).

Six-month olds who watched the clip didn’t know what to make of the two different hero squares. They didn’t have a clear preference between them. A group of ten-month olds, on the other hand, seemed to recognize that the intentional hero square was purposefully trying to help. The babies overwhelmingly preferred that square.

The authors say the next step is to study how this ingrained admiration for protective acts feeds into kids’ “developing notions of morality, justice, and heroism” and translates into real-life acts of heroism on the playground.

Nature Human Behaviour, 2017. DOI:10.1038/s41562-016-0037 (About DOIs).