After she turned 42, Teesha Karr thought she was done having kids. Six, in her mind, was perfect. And besides, she was pretty sure she had started menopause. For the past six months she’d had all the same signs as her friends: hot flashes, mood swings, tender breasts. She and her husband decided they could probably safely do away with contraception. But less than a month later, Karr felt a familiar twinge of pain in her ovary—the same twinge she’d felt every time she’d been pregnant before.

Karr felt embarrassed. “Teenagers accidentally get pregnant. Forty-two-year-old women don’t usually accidentally get pregnant,” she told me. But, really, 42-year-old women accidentally getting pregnant is surprisingly common. Nearly 4 percent of all new babies are born to women 40 and older, according to the latest data from the National Center for Health Statistics. As many as 75 percent of pregnancies in this age range are unplanned. It’s a frequent enough occurrence that the plots of Downton Abbey, Sex Education, And Just Like That, Grey’s Anatomy, and Black-ish have depended on it.

Many women still believe that by their 40s, unintended pregnancy just isn’t something they have to worry about. After all, many of us are told our whole lives that our biological clock is ticking, that our fertility plummets after 35, and that if we wait too long we’ll likely need some form of reproductive technology to get pregnant—if we can get pregnant at all. If conceiving at this age is so hard, surely you wouldn’t get pregnant by accident, right?

To understand why pregnancy can, and does, happen at this age, it helps to consider the wacky in-between land that is perimenopause. This stage, which can last anywhere from a few months to about eight years, is typically assumed to be a smooth transition into menopause. In reality, it’s more like the hormonal chaos of puberty, when the ovaries first sputter to life, wreaking all sorts of bodily havoc as they try to figure out their new groove.

In perimenopause, the ovaries are once again trying to adapt to a new normal. Only now they’re in overdrive, sending out scattered spurts of estrogen to recruit a much scarcer pool of eggs to release during ovulation. During this time, you might ovulate twice in one cycle, miss a cycle altogether, or experience unpredictable flash periods. “Those ovaries are kind of going nuts,” Robin Noble, a gynecologist and menopause specialist in Maine, told me. That can have all sorts of weird consequences. For one, extreme hormone spikes can stimulate the ovary to release extra eggs, which is one reason why fraternal twins are more common in older pregnancies.

If your ovaries are still ovulating, however sporadically, then you can still get pregnant. The likelihood of getting pregnant does decline with age, particularly toward the tail end of your 30s. By 40, according to the American Society for Reproductive Medicine, the chance of getting pregnant during a single menstrual cycle is less than 5 percent. The problem starts when these low odds lead women to use less reliable contraception, such as the rhythm method or withdrawal. Thanks to hormone spikes and the menstrual cycle becoming less predictable, those methods become even riskier during perimenopause, and the odds can stack up.

“I hear it every day,” Rachel Pope, an OB/GYN and the head of female sexual health at University Hospitals, in Ohio, told me. “Many women really think that their reproductive potential doesn’t exist anymore, which is not true.” In reality, you can’t be sure you’re in menopause—and therefore really done worrying about pregnancy—until you haven’t had a period for at least a year. For this reason, the Menopause Society recommends keeping a hormonal IUD in or continuing hormonal birth-control pills for a year after your last period, just in case.

To add to the confusion, some symptoms of perimenopause—missed periods, fatigue, mood shifts—resemble early signs of pregnancy. Lisa Perriera, an OB/GYN and the chief medical director of the Women’s Centers, a group of abortion clinics across several states, sees women almost every month who are shocked to find that their body is still capable of getting pregnant. “I’ve definitely cared for my share of 47-year-olds that are like, ‘I just thought it was menopause,’” she told me.

Because women in their 40s may be expecting aging-related changes in their body but not looking out for signs of pregnancy, many don’t realize they’re pregnant until 16 or even 20 weeks along, Perriera said. That’s what happened to Anne Ruiz. In 2017, the 43-year-old mom wasn’t experiencing any signs of perimenopause but figured her window for pregnancy was closing fast. Her period had always been irregular, so she wasn’t overly concerned when it didn’t come for a month or two. By the time she started getting morning sickness and took a pregnancy test, she was almost four months pregnant.

Ruiz and her husband welcomed the news, but also felt overwhelmed. “It was probably maybe like 60 percent excited and 40 percent Oh my God, how are we going to start over?” she told me. She gave birth the next year and immediately got an IUD.

Facing a pregnancy at a time when you think it is no longer a possibility can be profoundly distressing. “I do see a lot of people shaken by it,” Pope said. “Having a pregnancy that’s not planned can be just so life-altering,” especially at a time when abortions are difficult or impossible to access in many states. A common first reaction is denial. After Christina Ficicchia started experiencing irregular periods, at 42, her gynecologist told her she was in perimenopause. So when she missed a period entirely, she assumed her menstrual cycle was on its way out. Then she started “feeling” pregnant—“after you’ve been pregnant a few times, you kind of know,” she told me. Yet even after a positive pregnancy test, she asked her doctor to take an in-office test to confirm the results. After planning her first two children, Ficicchia struggled to wrap her mind around the choice that she now faced: “It was one that I realistically never thought that I had to make.”

Many women face extra distress because they know that being pregnant over the age of 40 comes with greater risks. The chance of miscarriage above that age rises to one in three, if not much higher, according to the Mayo Clinic. Pregnant people over 40 are also at a greater risk for preeclampsia, gestational diabetes, placenta previa, preterm delivery, hypertension, pelvic-floor injuries—“basically everything that could go wrong,” Pope said. Risks for Down syndrome and other chromosomal abnormalities also rise.

After talking with her obstetrician, Ficicchia ultimately chose to continue her pregnancy. Despite her heightened anxiety, she delivered her fourth child, Emmerson, at age 43 with no complications. Karr wasn’t so lucky. After she and her husband adjusted to the news, Karr told her other children to expect a new sibling, and even told her colleagues. Then, at her eight-week ultrasound, the technician told her the fetus had no heartbeat.

After finally having allowed herself to imagine another baby in her future, Karr was crushed. “I was pretty set with where I was in life and then this all happened and turned everything upside down,” she said. She is still trying to make sense of the loss, and dreads the weekly emails she still receives from pregnancy websites, telling her what to expect at each stage of pregnancy and advertising breastfeeding products. “If I’d known what was happening in my body, then this would have never happened,” she told me. “I was not informed.”

Of course, bodies can be confusing even for the extremely well informed—for instance, doctors who spend their days explaining perimenopause to their patients. When Pope missed her period in July and started feeling tenderness in her breasts, she had a hunch that she knew what was going on: perimenopause. At 38, she was on the early side. Still, she thought, “this is probably it,” she said. A spontaneous pregnancy seemed unlikely, given that she and her husband had used IVF for their two children and were planning on using it again.

“Then my husband, who’s a family doctor, was like, ‘Maybe you should check a pregnancy test,’” she said. In fact, Pope wasn’t perimenopausal. She was five weeks pregnant.