Denise M. Morrison, weaned on assurances from her father that the future would someday be led by women, yearned for the executive suite years before she occupied it.

When she finally reached the top, at Campbell Soup Company in August 2011, she had few female peers in the upper ranks of the largest companies in the United States.

Reflecting on her career in an interview with The New York Times last month, Ms. Morrison said she had “wanted to break the glass ceiling,” regardless of the obstacles. “It wasn’t only about me,” she added. “It was about the next generation of women coming behind me.”

On Friday, Ms. Morrison retired abruptly as Campbell’s chief executive. No specific reason was cited, but the company’s stock has slumped 30 percent in the past year and Campbell reported poor quarterly results on Friday.

In a statement released by the company, Ms. Morrison, 64, said, “I am proud of Campbell’s accomplishments and how we have transformed our portfolio amid changing consumer tastes for food and health and well-being.”

There are now just 23 female chief executives running publicly traded companies on the Standard & Poor’s 500-stock index. That is 4.6 percent of the total, a figure that edged above 5 percent for the first time last year. Those who remain include Mary Barra at General Motors, Indra Nooyi at PepsiCo and Marillyn Hewson at Lockheed Martin.

Ms. Morrison’s departure came after her S.&P. 500 peer, Margo Georgiadis, said last month that she was stepping down as the chief executive of the toy company Mattel. Ms. Georgiadis, who become chief executive of the genomics company Ancestry last week, led Mattel for just over a year.

“When there are so few women in these positions, every single departure is notable and depressing,” said Brande Stellings, senior vice president of advisory services at Catalyst, a nonprofit consulting and research firm on women in business. “Yet there does seem to be something larger at work here. We’re slipping back.”

Research has found that while female executives are much less likely than male executives to become the ultimate boss, they are more likely than men to do so if they stay on the management path for many years. Yet women are pushed out or leave at every stage along the way. At companies in the S.&P. 500, 45 percent of employees are women, but just 37 percent of midlevel managers and 27 percent of senior managers are women, according to Catalyst.

There are many reasons for the disparities. The corporate world demands long and inflexible hours, and female executives spend more time on family responsibilities than their male peers. The men in charge tend to be biased toward mentoring and promoting people like themselves, and biased against women who are assertive or competitive, necessary traits to reach the highest levels of business.

When women do get top jobs, research has found, it is more likely to be at troubled companies — and they do not get the resources or authority to stage turnarounds. Women are penalized more than men for negative performance and rewarded less for positive performance, other studies have found.

None of that seemed to sway Ms. Morrison, who had an eye on corporate leadership from childhood. In the interview with The Times last month, she called her upbringing “a training program for leadership.” Her sister, Maggie Wilderotter, was similarly inclined, becoming chief executive of Frontier Communications from 2004 to 2015.

Last summer, Ms. Morrison was among the business leaders to step down from President Trump’s manufacturing jobs initiative after Mr. Trump equivocated in his public statements about race-related violence in Charlottesville, Va.

Ms. Morrison, who declined to comment for this article, began her career at Procter & Gamble and then moved to Nestlé and PepsiCo before joining Campbell.

“I say to women, ‘Look, I broke the glass ceiling,’” she told The Times last month. “The next generation has to shatter it.”

Like many other women who have left top corporate jobs recently — Sheri McCoy at Avon, Irene Rosenfeld at Mondelez, Meg Whitman at Hewlett-Packard — Ms. Morrison is being succeeded by a man.

Keith R. McLoughlin, a member of the Campbell board since 2016 and previously the chief executive of Electrolux AB, a manufacturer of household appliances, will step in as interim chief executive, the company said.

He inherits a business in the midst of a deep identity crisis. On Friday, Campbell said it was undertaking a multimonth review of its entire portfolio, which includes brands like Pepperidge Farm, V8 and Swanson.

Campbell, which is based in Camden, N.J., estimates that it controls nearly 60 percent of the canned soup market. The nearly $6 billion soup, stews and bouillon segment has suffered in recent years as consumers grow increasingly wary of processed and canned foods, according to a report from the research group IBISWorld. Unlike older customers, the group found, younger buyers do not think of soup as a dietary staple and do not prioritize its convenience.

Perhaps in a sign of the challenges created by those shifting tastes, packaged food companies in the United States have shuffled chief executives 15 times since the start of 2016, the same number as in the previous seven years, according to an investor note from JPMorgan.

Under Ms. Morrison’s leadership, Campbell had tried to diversify. To appeal to health-minded consumers, it acquired the premium juice maker Bolthouse Farms for $1.5 billion in 2012 and later spent hundreds of millions of dollars on organic baby food manufacturer Plum Organics and organic dip and snack producer Garden Fresh Gourmet.

In 2015, Campbell even tinkered with its famous chicken noodle recipe to address the shifts in food trends. In 2016, it was the first in the industry to begin labeling products that included genetically engineered ingredients.

But the struggles continued. The news of Ms. Morrison’s departure accompanied Campbell’s third-quarter earnings report, in which the company said it had recorded a $393 million loss compared with a $176 million profit in the same period a year earlier.

Campbell now expects its earnings per share for the year to slump 5 to 6 percent after previously projecting a decline of 1 to 3 percent.

Campbell, whose most recent big deal was the multibillion-dollar acquisition of the snack maker Snyder’s-Lance, announced a reorganization last month that gave control of key divisions — including soup, beverages and snacks — to Luca Mignini, the chief operating officer.