For years, anthropologists and evolutionary biologists have struggled to explain the existence of menopause, a life stage that humans do not share with our primate relatives. Why would it be beneficial for females to stop being able to have children with decades still left to live?

According to a study published today in the journal Proceedings of the Royal Society B, the answer is grandmothers. “Grandmothering was the initial step toward making us who we are,” says senior author Kristen Hawkes, an anthropologist at the University of Utah. In 1997 Hawkes proposed the “grandmother hypothesis,” a theory that explains menopause by citing the under-appreciated evolutionary value of grandmothering. Hawkes says that grandmothering helped us to develop “a whole array of social capacities that are then the foundation for the evolution of other distinctly human traits, including pair bonding, bigger brains, learning new skills and our tendency for cooperation.”

The new study, which Hawkes conducted with mathematical biologist Peter Kim of the University of Sydney and Utah anthropologist James Coxworth, uses computer simulations to provide mathematical evidence for the grandmother hypothesis. To test the strength of the idea, the researchers simulated what would happen to the lifespan of a hypothetical primate species if they introduced menopause and grandmothers as part of the social structure.

In the real world, female chimpanzees typically live about 35 to 45 years in the wild and rarely survive past their child-bearing years. In the simulation, the researchers replicated this, but they gave 1 percent of the female population a genetic predisposition for human-like life spans and menopause. Over the course of some 60,000 years, the hypothetical primate species evolved the ability to live decades past their child-bearing years, surviving into their sixties and seventies, and eventually 43 percent of the adult female population were grandmothers.

How would grandmothers help us live longer? According to the hypothesis, grandmothers can help collect food and feed children before they are able to feed themselves, enabling mothers to have more children. Without grandmothers present, if a mother gives birth and already has a two-year-old child, the odds of that child surviving are much lower, because unlike other primates, humans aren’t able to feed and take care of themselves immediately after weaning. The mother must devote her time and attention to the new infant at the expense of the older child. But grandmothers can solve this problem by acting as supplementary caregivers.

In the hypothesis—and in the computer simulation—the few ancestral females who were initially able to live to postmenopausal ages increased the odds of their grandchildren surviving. As a result, these longer-lived females were disproportionately likely to pass on their genes that favored longevity, so over the course of thousands of generations, the species as a whole evolved longer lifespans.

But why would females evolve to only ovulate for 40 or so years into these longer lives? Hawkes and other advocates of the hypothesis note that, without menopause, older women would simply continue to mother children, instead of acting as grandmothers. All children would still be entirely dependent on their mothers for survival, so once older mothers died, many young offspring would likely die too. From an evolutionary perspective, it makes more sense for older females to increase the group’s overall offspring survival rate instead of spending more energy on producing their own.

Hawkes goes one step further, arguing that the social relations that go along with grandmothering could have contributed to the larger brains and other traits that distinguish humans. “If you are a chimpanzee, gorilla or orangutan baby, your mom is thinking about nothing but you,” she says. “But if you are a human baby, your mom has other kids she is worrying about, and that means now there is selection on you—which was not on any other apes—to much more actively engage her: ‘Mom! Pay attention to me!’”

As a result, she says, “Grandmothering gave us the kind of upbringing that made us more dependent on each other socially and prone to engage each other’s attention.” This trend, Hawkes says, drove the increase in brain size, along with longer lifespans and menopause.

The theory is by no means definitive, but the new mathematical evidence serves as another crucial piece of support for it. This could help anthropologists better understand human evolution—and should give you another reason to go thank your grandmother.