Beth Bergmans liked working as a project manager for an online university based in Minnesota.

“We are offering opportunities for people to advance in life — that brought some satisfaction,” she said. “And the people I work with are awesome.”

Bergmans, 63, planned to stay on the job for two years, until she qualified for Medicare. But in recent months, things shifted. She began to find it harder to recall the details of recent meetings, to retrieve words and to filter out distractions. She took short breaks at her desk to recharge.

“You find ways to adapt,” she said. “You use Post-it notes and whiteboards, and you spend more time prepping before a meeting.”

Nobody complained or even seemed to notice, but Bergmans worried.

“People don’t really talk about this, the fear that you’re starting to slip professionally,” she said. “The last thing I want is to crash and burn at the end because I didn’t recognize that it was time to stop.”

So a couple of weeks ago, Bergmans told her manager that she would retire at the end of the year.

Sometimes it works this way: People engaged in and proud of their careers, intending to continue past typical retirement ages, encounter internal or external difficulties and step aside, even if no one is urging them to resign or retire.

And sometimes, even if lots of people are urging them to, they don’t.

Consider Dianne Feinstein, a six-term senator who faced questions about her competence while growing increasingly frail and confused. She agreed to not seek reelection after her term ended in 2025, but refused to resign.

When she died in office last fall, she was the Senate’s oldest member, at 90.

Consider Sumner Redstone, who held onto the leadership of his $40 billion media empire, including Viacom and CBS, despite pressure from investors and analysts. When an interviewer asked about his succession, he replied, “I’m not going to die.”

After facing a lawsuit that portrayed him as mentally incompetent, Redstone resigned from CBS at 92 and Viacom at 93, inciting legal battles over control of the companies. He died in 2020 at 97.

“People who have more authority and status and control over their jobs are much less likely than others to retire voluntarily,” said Teresa Ghilarducci, an economist at the New School for Social Research.

“People with authority in the workplace actually have less stress,” she added. “Having a boss at older ages is deleterious to your health, but being a boss is good for you.”

Only a fraction of older Americans fall into this category, in which good health enables extended careers while financial security makes further employment unnecessary.

Ghilarducci’s analysis of data from the national Health and Retirement Study shows that only a third of those working at ages 62 to 70 can afford to retire but choose not to. Most who are still employed at that age are working because of financial need.

In 2022, almost 40% of U.S. households were at risk of being unable to maintain their standard of living in retirement, according to the Center for Retirement Research at Boston College.

“This is a rare bird,” said Lisa Berkman, an epidemiologist at the Harvard T.H. Chan School of Public Health. “Very few people have the luxury of working because they love their jobs and want to continue.”

Those who work only because they want to tend to be well off and well educated, she added, with flexible workplaces and physically undemanding jobs.

Why not hand over the reins when doubts surface about continuing? Retirement can be attractive, after all. Most retired adults reported feeling “free” (59%) and “relaxed” (72%) in an AARP survey. And an international meta-analysis found that retirement was associated with a reduced risk for depression.

Popular culture tends to extol this phase of life: Notice all those older couples dancing on beaches and cruise ships in television commercials.

Yet “the reality is that retirement can be a very challenging time,” said Teresa Amabile, a psychologist at Harvard Business School and a co-author of “Retiring: Creating a Life That Works for You.”

The end of a career means “the loss of being a wage earner, of being a member of an organization or of a profession,” said Amabile, who retired this month at 74. It’s “the loss of being someone needed, counted upon, respected, perhaps powerful if you’ve been the head of a major corporation — or the president of the United States.”

Particularly disturbing, Ghilarducci pointed out, is an involuntary retirement for reasons such as scandal, a health crisis or dismissal.

“You’re more likely to be depressed and anxious,” Ghilarducci said. “Being forced out is one of the worst things that can happen to an older adult.”

Researchers have identified sequences of developmental tasks or phases that older employees work through to find satisfaction in their post-work lives. When retirement is involuntary, “the tasks of the transition get short-circuited,” Amabile said.

“The person never gets the chance to make a deliberate decision. They don’t have that sense of closure on a career, that sense of agency and control.”