Parents and educators are acutely aware that children can be both excessively self-oriented and overwhelmingly generous. For every preschooler refusing to share his toy truck, there’s an eight year old who insists on giving all of his allowance money to the homeless. Kids can also enjoy their altruism. One study found that even two year olds were happier giving something away than receiving a gift.

But research also finds that this natural generosity can be stunted by environmental factors—and one of them, it seems, is wealth. Across a range of studies, college students and adults from affluent backgrounds have shown less interest in connecting with other people and less financial generosity than their poorer counterparts. The repercussions go beyond an obvious rise in the disparity between rich and poor. Traits like empathy, generosity, and compassion also have a positive influence on individual health and happiness.

So when does a family’s socioeconomic status begin to influence a child’s prosocial behavior—and how might that affect his or her health? To answer these questions, Jonas Miller and his colleagues at the University of California, Davis, had 74 preschool-age children perform a series of tasks for which they could earn tokens. They were then given the choice of donating none, some, or all of their tokens to anonymous sick children, who were unable to come and earn prizes for themselves. The children were left alone to decide whether to transfer any of tokens from their box to one reserved for their sick counterparts. The researchers also gathered information on each child’s family income (which ranged from $15,000 to more than $150,000 per year).

Throughout the tasks, Miller’s team used a device called an EEG to measure activity in the children’s parasympathetic nervous system (PNS), which helps us keep our cool in threatening situations. Healthy PNS functioning is linked to many positive health outcomes—and children from economically disadvantaged backgrounds are often found to have problems with their PNS functioning.

Miller and his colleagues found that children from less wealthy families gave away more of their tokens than did children from wealthier families. Given what we know about adult behavior, that results was not surprising.

However, the researchers also found that more generous children exhibited healthier PNS functioning throughout the various phases of the task, regardless of whether they came from a rich or poor family. Interestingly, once the task was completed, the children who showed the healthiest physiological response were the generous children and the children from wealthier backgrounds. This suggests that the act of giving may offset the physiological disadvantage from which poorer children seem to suffer.

The takeaway: Material wealth may indeed have small but powerful effects on our children’s desire to give to others—we see it or not, our children might be internalizing family wealth. But for less affluent children who act on their altruistic impulses, their generosity may well provide a powerful buffer against the negative physiological affects of poverty.

This research empowers those of us raising or working with less affluent children to encourage generosity among them. Luckily, many people believe that we can teach altruism to children of any background by setting positive examples and structuring their environment in certain ways. So whether you try to foster generosity by establishing a safer, more connected classroom or starting a daily meditation practice with your child, you’re not just doing good for our world. You’re also doing good for their health.