Getty Images A child sleeps with his hand tied to a bar at an orphanage in Ploiesti, Romania, on May 16, 1990. This particular orphanage is for children who have birth defects, deformities and intellectual disabilities.

Related The Economic Case for Preschool Slate

Most people don’t need science to appreciate the importance of a mother’s love. But to understand how early maltreatment can derail a child’s development requires careful study — and is fraught with ethical peril.

Such research is therefore often conducted in animals. A new analysis of data on 231 rhesus macaque monkeys explored the effects of three early-childhood conditions on the animals’ later lives. About half of the monkeys were raised normally by their mothers, living in social groups with other monkeys — a condition similar to their natural environment.

One quarter of the monkeys were reared in a nursery without their mothers until day 37, when they were placed in groups of four other monkeys of a similar age.

The final group was also nursery-raised at first, but then these babies were transferred to a cage, where they spent most of their time, with a hot water bottle covered in terrycloth. (Two hours a day, these monkeys were allowed to interact with other monkeys their age.) The condition was similar to that used in the well-known “cloth mother” primate experiments by Harry Harlow, which had previously demonstrated that proper psychological and physical development of infants requires nurturing and attention from a parent, not just the provision of food and water. In that research, socially isolated monkey babies that were removed from their mothers were found to prefer clinging to a cloth-covered surrogate mother for comfort, rather than a harsh wire sculpture, even when only the metal mother provided bottles of milk.

(MORE: Never Wake a Sleeping Baby: Why Depressed Moms Don’t Follow that Advice)

While such experimentation sounds cruel, this type of research has been critical in helping change policies in human orphanages that had for centuries treated infants equally inhumanely. Despite early evidence that orphanage infants were far more likely to die than others, proponents argued that it didn’t matter whether children had “parents” specially devoted to them at the orphanage, claiming that simply feeding and changing them appropriately would be adequate until adoptive parents were found. Babies, they said, couldn’t remember anyway.

The harrowing consequences of these theories were most vividly brought to light in Romania in the 1980s and ’90s, when a ban on abortion led to a surge in orphanage babies. The longer these children were left in their cribs, simply being fed and changed without individualized affection, the more damage was seen, even if the orphanage was clean and well-run. Many children developed autistic-like behaviors, repetitively rocking or banging their heads. Some were cold and withdrawn or indiscriminately affectionate; some alternated between these extremes. And they simply didn’t grow like normal infants: their head circumferences were abnormally small and they had problems with attention and comprehension.

Still, orphanage advocates blamed pre-existing problems that had led parents to give up the children in the first place, not institutional conditions. This debate continued until researchers were allowed to randomize abandoned infants without clear birth defects to either usual orphanage care or foster care from birth. (To mitigate the thorny ethics of the study, adoption was encouraged as early as possible for the orphanage-assigned kids, even though that could have potentially weakened the findings.)

Nonetheless, the study showed that the children who were placed in foster care developed normally, with appropriate head sizes, and less distress, better attentional skills and a 9-point higher IQ on average, compared with children sent to orphanages. Follow-up studies found that the orphanage-raised group was more than twice as likely to develop mental illness, compared with those who’d been in foster care. More than 50% of the orphanage group was diagnosed with at least one mental illness.

(PHOTOS: One Family’s Experiment with Attachment Parenting)

Only after this research was published in 2007 did Romania change its policies, though there are still some countries that continue to place abandoned infants in these dangerous settings. Because the problem persists, and also because other early child abuse and neglect can replicate such situations, ongoing study of what harms children in early childhood and what helps their recovery is needed.

In the new research, the monkeys remained in the various rearing conditions — with their mothers, with peers or mainly isolated — until they were about six months old. That’s the human equivalent of age 3 — when the brain is developing at a faster rate than at any other time in postnatal life.

After the 6-month period, the monkeys were placed in a mixed social group, comparable to the normal conditions for their species. They were studied when they were about 1 year old.

The results differed by gender, an effect also seen in humans suffering from child maltreatment. Male monkeys reared in isolation were nearly twice as likely to come down with physical illnesses as those reared by their mothers or with peers. They were also more than five times as likely to show stereotyped behavior, the repetitive motions similar to the rocking or head-banging seen in some cases of autism and in orphanage-reared infants. The peer-reared males were about three times more likely to engage in stereotyped behavior, compared with those raised by their mothers.

In females, surprisingly, the peer-reared group did worse than the monkeys raised in isolation. They were far more likely to be wounded and to suffer hair loss than monkeys raised by their mothers or in isolation. The researchers found that the peer-reared females were more aggressive than other monkeys, suggesting that the wounds may have resulted from fights and the hair loss from hair-pulling by others.

While the males had high levels of a stress hormone known as cortisol and low levels of the metabolite of the mood-related neurotransmitter serotonin, this difference was not seen in females. Lead author Gabriella Conti of the University of Chicago suggests that this may be because in the womb, female fetuses are also more resilient than males.

High levels of stress hormones can increase risk for both mental and physical illnesses, including depression, which also can involve low levels of serotonin.

(MORE: How to Cut Crime, Alcoholism and Addiction? It’s Not Elementary, But Preschool)

The authors conclude: “[T]he lack of a secure attachment relationship in the early years has detrimental consequences for both physical and mental health later in life, with long-lasting effects that vary by sex. The persistence of these effects after the end of treatment emphasizes the need to intervene early in life to prevent long-term damage.”

Another of the paper’s authors, the Nobel-prize-winning economist James Heckman, has long argued that investing in early childhood education provides a greater return for society than virtually any other type of spending, not only because of increased educational success and productivity, but also because of reduced crime, addiction, distress and disorder. This study, he says, “shows that early life conditions critically affect adult health. Maternal attachment plays a fundamental role in shaping who we are; remove it and the harm is great.”

Indeed, research on early interventions for at-risk families, such as the Nurse Family Partnership and the Perry Preschool Project — which, respectively, provides care for low-income mothers and babies, and offers high-quality preschool education for poor African American children — has shown significant reductions in crime and teen pregnancy, along with gains in education and employment when the children involved in the programs grow up.

It may seem obvious that an isolated, parentless toddler — with or without social contact with peers — will suffer emotionally from lack of parental love. What’s not obvious is that without devoted, repeated acts of love, a child’s brain doesn’t make the growth hormone needed for proper mental and physical development and numerous other imbalances are also created.

While we must try to spare all children, and even other primates, from being subjected to these dysfunctional early life environments, we still need to study how to best overcome them. Fortunately, children overcome troubled childhoods all the time: many children who are adopted out of harmful settings do manage to adjust and ultimately thrive. The earlier they are reached, the better they do. Comparing them with those who do not do as well — and in nonhuman primates, focusing on the resilient animals — could provide important insight into how to help.

The research was published in the Proceedings of the National Academy of Sciences.

Maia Szalavitz is a health writer for TIME.com. Find her on Twitter at @maiasz. You can also continue the discussion on TIME Healthland‘s Facebook page and on Twitter at @TIMEHealthland.

MORE: The Man Who Remade Motherhood