Have you ever received an unexpected kindness? A stranger in the car ahead of you paid your highway toll. Or a kind consumer picked up your tab at Starbucks. These actions can set off a chain reaction of kindness, as you pay that kindness forward to the next unsuspecting person in line.

But when does this pay-it-forward mentality first emerge in humans? New research at the University of Virginia found that the phenomenon is first seen in 4-year-olds.

In a pair of studies, experimenters worked with two groups. In the first study, 3- and 4-year-olds were called into a room individually and shown a transparent, locked box containing five enticing, colorful animal stickers. The experimenter then told each child a previous toddler – let’s call her Sally – left a note sharing the location of the key to the box, which was hidden in the room. After finding the key, opening the box and collecting their treasures, the toddlers were asked by the experimenter if they would like to share some of their stickers with a new child.

The results were clear. Most of the 3-year-olds (80%) did not want to share, while most of the 4-year-olds – about 60% of them – did. The study’s lead author, Stefen Beeler-Duden, a graduate psychology student, calls this generosity “upstream reciprocity.”

In the second study, Beeler-Duden set out to learn what was driving the upstream reciprocity in the 4-year-olds. To do so, he relied on a particular conceptualization of emotions, according to which the feelings are made up of an individual’s evaluation of certain parts of a situation. Based on this model, Beeler-Duden broke down gratitude into two key parts: the gift itself and the actions of the person who provided the gift.

“Importantly, if one doesn’t recognize and approve of the person’s actions, then one should only feel a sense of joy or happiness about the gift, but not the sense of gratitude that comes from both of the key parts,” he said.

So Beeler-Duden replicated the sticker experiment with a new group of 4-year-olds and then asked them to evaluate Sally, the mysterious helper. Was she good, bad or just OK? He found that the children who positively evaluated Sally shared more stickers. It was, he said, “something like the emotional experience of gratitude.”

“Moreover, children’s positive evaluations of Sally were correlated with children’s upstream reciprocity, that is, how many stickers they shared with the new child,” reads part of the new study, published in the Journal of Experimental Child Psychology.

So why are 4-year-olds more likely than 3-year-olds to share their animal stickers?

“It seems that 4-year-olds are really paying attention to these different components that are associated with gratitude, noticing not only that they received something nice, but also that this person wanted to help them,” Beeler-Duden said, “whereas it seems that 3-year-olds are not necessarily tuned fully into these different components just yet.

“It also may be that our sticker game was a little bit too difficult for 3-year-olds, because there’s a lot to keep track of.”

Still, the findings open a new window into when humans begin to pay benefits forward.

“It helps us better understand children’s upstream reciprocity,” Beeler-Duden said. “There’s been some work looking at upstream reciprocity, but no study has really looked at when it first emerges and what motivates children to show this behavior.”

He said people have made the argument that young children engage in upstream reciprocity when they feel good. These two studies bring new evidence to the act of paying things forward.

“I think our study is designed well enough that we can say that it’s not just positive emotion driving the sharing,” he said. “It’s something about the components of gratitude that are really playing into children’s upstream reciprocal behaviors and their pay-it-forward behavior.”