Some people think we’re shaped primarily by genes. Others believe that the environment we grow up in is most important. But now evidence is mounting that a third factor is also critical: our uterine environment before we’re even born.

Researchers are finding indications that obesity, diabetes and mental illness among adults are all related in part to what happened in the womb decades earlier.

One of the first careful studies in this field found that birth weight (a proxy for nutrition in the womb) helped predict whether an adult would suffer from heart disease half a century later. Scrawny babies were much more likely to suffer heart problems in middle age.

That study, published in 1989, provoked skepticism at first. But now an array of research confirms that the fetal period is a crucial stage of development that affects physiology decades later.

Perhaps the most striking finding is that a stressful uterine environment may be a mechanism that allows poverty to replicate itself generation after generation. Pregnant women in low-income areas tend to be more exposed to anxiety, depression, chemicals and toxins from car exhaust to pesticides, and they’re more likely to drink or smoke and less likely to take vitamin supplements, eat healthy food and get meticulous pre-natal care.

The result is children who start life at a disadvantage — for kids facing stresses before birth appear to have lower educational attainment, lower incomes and worse health throughout their lives. If that’s true, then even early childhood education may be a bit late as a way to break the cycles of poverty.

“Given the odds stacked against poor women and their fetuses, the most effective antipoverty program might be one that starts before birth,” writes Annie Murphy Paul in a terrific and important new book called “Origins: How the Nine Months Before Birth Shape the Rest of Our Lives.”

Another groundbreaking and provocative book this year makes the same case: “More than Genes,” by Dan Agin, a neuroscientist at the University of Chicago. Both offer a new window into the unexpected forces that shape us.

One study in this field, by a Columbia University economist, Douglas Almond, looked at children who were born after the great flu pandemic of 1918. The pandemic lasted only about five months and infected about a third of pregnant women in America, so Mr. Almond compared those who had been exposed to it while inside their mothers with others born just before or after.

Ms. Paul quotes Mr. Almond as concluding, “People who were in utero during the pandemic did worse, on average, on just about every socioeconomic outcome recorded.” They were 15 percent less likely to graduate from high school, 15 percent more likely to be poor, and 20 percent more likely to have heart disease in old age.

Stress in mothers seems to have particularly strong effects on their offspring, perhaps through release of cortisol, a hormone released when a person is anxious. Studies show that children who were in utero during the Arab-Israeli Six-Day War of 1967 were more likely to have schizophrenia diagnosed as adults. And The Journal of the American Medical Association reported that Chinese born during the terrible famine from 1959 to 1961 were twice as likely to develop schizophrenia as those born at other times.

As for obesity, Ms. Paul describes several British scientists who fed pregnant rats junk food: doughnuts, marshmallows, potato chips and chocolate chip muffins. The offspring of those rats turned out to have a sweet tooth as well: they were more likely to choose junk food when it was offered and ended up 25 percent fatter than rats whose mothers were fed regular rodent chow.

This field of “fetal origins” is still in its infancy, but one implication is that we should be much more careful about exposing pregnant women to toxins, and much quicker to regulate chemicals that are now widely used even though they’ve never even been tested for safety. Professor Agin is particularly eloquent about the potential perils of lead, dioxins, PCBs, radiation and pesticides.

One study looked at Swedish children who were fetuses during the 1986 Chernobyl nuclear accident. The radiation exposure was very slight and did not seem to affect their physical health. But their cognitive abilities, especially in math, seemed affected, and they were one-third more likely to fail middle school.

The uncertainty in this field is enormous, but we have learned that a uterus is not a diving bell that insulates its occupant from the world’s perils. Chemicals like thalidomide and DES proved tragic for those exposed to them while in their mothers’ wombs. And it’s now high time to take a closer look at unregulated chemicals that envelop us — and may be shaping our progeny for decades to come.