For years, scientists have tried to understand why some people jump at the chance to help strangers while others look away. A new study from German universities suggests the answer might begin in childhood — before a person is even old enough to remember it.

Researchers at the University of Oldenburg and the University of Bonn found that oxytocin, the brain chemical often called the "love hormone," affects generosity in opposite ways depending on a person's early-life experiences. The study was published in the journal Translational Psychiatry.

Oxytocin is naturally released during bonding moments like hugging, nursing babies, or spending time with friends. Past research showed that giving people extra oxytocin through a nasal spray can change how they behave socially, but the results were inconsistent. Sometimes people became more generous; sometimes they did not.

The new research may explain why. The team recruited 61 men who had no known physical or mental health conditions. Each participant completed a test called the Childhood Trauma Questionnaire, a standard tool for measuring hardships experienced before age 18. Then half received an oxytocin nasal spray and half received a placebo, an inactive substance with no effect.

While lying inside a powerful 7-Tesla brain scanner — which can detect tiny activity changes in the brain — participants made real choices about donating part of their payment to strangers in need.

The results were striking. Among men who reported more childhood hardship, oxytocin increased their willingness to give money away. But among those who reported fewer difficulties growing up, the same hormone actually reduced their generosity.

The researchers also spotted differences in brain activity. Participants' responses tracked with changes in two brain regions: the medial prefrontal cortex and the middle cingulate cortex. These areas work together during social thinking and empathy.

Nina Marsh, the study's lead author, said the findings challenge the idea that oxytocin works the same way for everyone.

"Rather than showing a universal effect of oxytocin, our findings suggest that its effects depend on an individual's early-life experiences," Marsh told Phys.org. "Early-life experiences do not determine who we become, but they may shape how the adult brain responds to social signals."

Marsh said the study could eventually help explain why people respond so differently to others in need. Understanding these patterns might one day guide better support for children who face hard beginnings, she added.

For now, the research offers a quiet reminder that the seeds of kindness — or caution — may be planted long before we ever have to choose whether to help a stranger.