Declining rates of adolescent pregnancy come with a catch.

A child whose mother had her as a teenager is set up to have a tough life. Compared with peers whose parents gave birth later, this child is at a greater risk of being born prematurely, of struggling to acquire basic skills such as literacy and self-control, and of underperforming in school.

This child is alsomore likelyto becomea teen mother herself. Adolescent pregnancy isn’t genetic, but it is hereditary in a way. The child of a teen mom is bound to inherit the circumstances—poverty, familial instability—that potentially contributed to the pregnancy in the first place. And the baby might encounter those circumstances more acutely, because teen motherhood itself can create new layers of hardship for both parent and child. By the time the children of teen moms start school, many are already at a disadvantage relative to their peers.

The good news is that women around the world are having children later in life, including in the United States, where the teen-pregnancy rate dropped by roughly two-thirds from 1990 to 2016. The bad news? This positive trend might come with a major caveat: The effects of teen pregnancies generations ago, new research suggests, are still being felt.

A peer-reviewed study recently published in the journal PLOS Onefinds that having a grandmother who had her first kid as a teen is a strong predictor for whether a child will underperform in school—even for a child whose own mother gave birth as an adult, not a teenager. That particular child is, in fact, 39 percent more likely to place in the bottom 10th percentile of scores measuring whether kindergartners are ready for school than a classmate whose grandmother and mother became parents as adults. (The study defines an adult mother as one who was at least 20—an age cutoff often used to define adolescent pregnancy—when she gave birth to her first child.)

The study, co-written by several public-health scholars, including Elizabeth Wall-Wieler, a postdoctoral research fellow at Stanford University’s School of Medicine, analyzed census-like data on 11,300 children in the Canadian province of Manitoba who were born between 2000 and 2009. The researchers then paired the data with statistics on those kids’ “school readiness”—their physical independence, social behaviors, basic numerical knowledge, and ability to communicate effectively, for example—as scored by Manitoba’s kindergarten teachers on a detailed questionnaire.

They chose to focus on Manitoba because of its comprehensive population data and detailed statistics on school readiness, which made it a uniquely apt place to investigate the multigenerational effects of teen pregnancy on academic performance. According to Wall-Wieler, this study is the first ever to probe that question.

Predictably, the study found that school readiness was highest among children for whom neither mother nor grandmother was an adolescent mom, and was lowest among children at the opposite end of the spectrum. Among children of non-adolescent mothers and non-adolescent grandmothers, fewer than a quarter (24 percent) were deemed unready for school in kindergarten. The same was true, meanwhile, of nearly half—46 percent—of the children whose mothers and grandmothers had kids in adolescence.

But what’s especially noteworthy, again, is that the correlation between a child’s school readiness and the age at which her grandma became a mother seems to persist even when the child’s own mother was not a teen mom. Among kids whose mothers but not grandmothers were adolescent moms, 41 percent were not ready for school in kindergarten; for kids whose grandmothers but not mothers were adolescent moms, the rate was 34 percent. Wall-Wieler attributes this phenomenon to the insidious and persistent consequences of poverty, and to the inability of education systems to usher many kids out of that trap.

“What this research really demonstrates is the value of supporting young mothers when they have children in adolescence,” Wall-Wieler says. This support “doesn’t just improve their own lives—it also improves the lives of their children and the lives of their grandchildren.”

The reason there’s been so little research about the multigenerational effects of teen parenthood is symptomatic of a larger research conundrum. Numbers alone paint an incomplete portrait of teen motherhood. For one thing, a line item in a census spreadsheet isn’t going to specify whether a given adolescent pregnancy was intentional, for example, or whether that teen had the support of wealthy parents.

For another, it’s hard to suss out all the background factors that play into whether a person will become a teen parent and the chances a child has at academic success. “Teen parenthood doesn’t lead to social and economic disadvantage,” Karen Benjamin Guzzo, a Bowling Green State University sociologist who studies demography and family trends, told me in an email. “It’s the other way around.” In other words, most teen moms are poor not because of their adolescent pregnancy, but because poverty tends to begetmore poverty.

In a similar vein, many of the children and grandchildren of teen moms struggle academically not because they’re unintelligent, but because they’re poor. Poverty can distract them from their learning and undermine their achievements in the classroom; a teen mom’s low academic performance can foster in her a resentment of school, an attitude that she might pass on to her own kid. “It’s easier to look at what’s happening, and more difficult to see why that’s happening,” Wall-Wieler says.

Wall-Wieler says her study lends important nuance to discussions of why. Elusive answers to that question are crucial to making countries like the U.S. and Canada more egalitarian. Absent those answers, the link between circumstance of birth and opportunity might remain as stubborn as ever.

Alia Wong is a staff writer at The Atlantic, which originally published this article.