Pension funds, endowments, 401(k) retirement plans and retail investors are flooding into passive investment funds, which run on autopilot by tracking an index. Stock pickers, archetypes of 20th century Wall Street, are being pushed to the margins.

Over the three years ended Aug. 31, investors added nearly $1.3 trillion to passive mutual funds and their brethren—passive exchange-traded funds—while draining more than a quarter trillion from active funds, according to Morningstar Inc.

Advocates of passive funds have long cited their superior performance over time, lower fees and simplicity. Today, that credo has been effectively institutionalized, with government regulators, plaintiffs’ lawyers and performance data pushing investors away from active stock picking.

In developed markets, “the pressure has gotten so great that passive has become the default,” said Philip Bullen, a former chief investment officer at active-management powerhouse Fidelity Investments. He and others say active management can succeed with less widely traded assets.

The upheaval is shaking Wall Street.

Hedge-fund managers, the quintessential active investors, are facing mounting withdrawals as they struggle to justify their fees. Hedge funds, which bet on and against stocks and markets world-wide and generally have higher fees than mutual funds, haven’t outperformed the U.S. stock market as a group since 2008.

Some giants of passive investing, such as Vanguard Group and BlackRock Inc., are attracting lots of money and gaining clout in shareholder votes at public companies.

Although 66% of mutual-fund and exchange-traded-fund assets are still actively invested, Morningstar says, those numbers are down from 84% 10 years ago and are shrinking fast.

Performance is driving the upheaval. Over the decade ended June 30, between 71% and 93% of active U.S. stock mutual funds, depending on the type, have either closed or underperformed the index funds they are trying to beat, according to Morningstar.

Moreover, because matching the performance of stock indexes is far cheaper than trying to beat them, index funds’ expenses are a fraction of what active funds charge—sometimes 1/30th or less. With interest rates near zero, fees stand out more than ever.

There is a downside, according to active-investing advocates. Passive funds are designed only to match the markets, so investors are giving up the chance to outperform them. And if fewer managers are drilling into financial reports to pick the best stocks and avoid the worst—index funds buy stocks blindly—that could eventually undermine the market’s capacity to price shares efficiently.

That isn’t stopping one of the largest migrations of money in history.

“It is time to acknowledge the truth,” said a March shareholder letter from Cohen & Steers Inc., manager of real-estate and other specialized active funds. Stock picking in its current form “is no longer a growth industry.” Active-fund firms that don’t “position themselves for the sea change” will be “relegated to the dustbin of history.”

Employer-sponsored 401(k)-style retirement plans have 25% of their assets in index funds, up from 19% in 2012, according to investment-consulting firm Callan Associates Inc. Public pension plans had 60% of their U.S. stock allocations in index funds in 2015, up from 38% in 2012, according to research firm Greenwich Associates. At endowments and foundations, the index-fund share rose to 63% from 40% in that time period.

The biggest passive portfolio, Vanguard Total Stock Market Index Fund, now has $469 billion in assets, nearly as much as the four largest active funds combined. Fidelity’s 500 Index fund, at $103 billion, may soon surpass the firm’s largest active portfolio, Contrafund, which holds $108 billion.

“I was very much a believer in active management,” he said. “I thought markets were inefficient to the point where active management made a difference.”

A few years ago, he noticed that the roughly 40 active funds in the law firm’s menu were recovering from the 2008-09 market meltdown more slowly than their benchmarks and the index funds that track them.

“That’s when it dawned on me that we were not doing something right,” he recalled.

In the spring of 2014, over lunch, Mr. Chesner and the two other members of the retirement plan’s executive committee decided on a change. By going with an all-index-fund lineup, the firm’s employees would save an average of 1.59 percentage points in annual expenses.

“When you look at the fact that people are living longer, that makes a huge difference” in retirement savings, said Mr. Chesner. “It’s almost a no-brainer.”

Lawsuits also are motivating investors to make changes. Over the past decade, Jerome Schlichter, a plaintiffs’ lawyer, has been suing corporations and, more recently, colleges and universities, contending the employers breached their fiduciary duty by allowing unreasonably high fees in their 401(k)-style plans.

Mr. Schlichter’s cases, 40 in the past decade including 15 this year, “are not saying that active management is per se imprudent,” he said. Instead, they put the burden on a plan to show there is a reasonable likelihood an investment will beat the market persistently after fees—“a pretty big burden of proof,” he said, given active management’s costs and record.

Companies and schools have generally defended their plans, calling them generous, well-designed and legal.

Board members were motivated mainly by a desire to reduce costs and make investment choices easier to understand.

With index funds, “if you pick up a newspaper and see how the S&P performed, you will know how your portfolio did,” said board Chairman Marc Levine. “They provide perfect transparency.”

The fee lawsuits also influenced the decision, he said. At a recent meeting, the board’s attorney “walked us through the potential liability if there is harm to even a single participant,” he said. “It was quite a wake-up call.”

Board members worried participants are more likely to “chase performance” with active funds by piling into portfolios that shine one year only to lag behind the next, said Mr. Levine, a former investment banker. “If that manager concentrates the investment portfolio and a stock blows up, that’s a potential legal problem for us.”

The Illinois board will shift $2.8 billion from active funds at companies including Fidelity Investments, Invesco Ltd. and T. Rowe Price Group Inc. into index funds managed by Vanguard and Northern Trust Corp. The board expects the switch to reduce fees to 0.09%, from 0.37%.

Fidelity and Invesco declined to comment. T. Rowe Price respects the Illinois board’s decision, said a spokesman, but remains “confident in the value added by our actively managed strategies.”

When Stephen Sexauer,chief investment officer at the San Diego County Employees Retirement Association, took over last year, the public pension fund was paying an average of 1.1% in investment expenses, nearly twice what comparable plans in other California counties paid, without earning better returns, he said.

“You have to ask yourself, ‘If we’re spending all this money on fees, where’s the evidence of success?’ And it’s really hard to find,” he said.

So the plan moved 25% of its assets—$2.5 billion at the time—into index funds charging average fees of .05%.

Mr. Sexauer also placed $100 million in a so-called balanced portfolio of 70% stock index funds and 30% bond index funds. All the plan’s other investments will be pitted, in a kind of tournament, against that portfolio. If they don’t deliver, they will be axed, he said.

The internal index fund “is kind of like Pac-Man,” he said. “If it outperforms over time, eventually a capable administrative assistant might be able to run the entire investment department, and we’d be OK with that.”

“What’s going on is a generational shift,” said John D. Skjervem, 54 years old, chief investment officer of the Oregon State Treasury, which oversees $90 billion in public assets and trust funds. “Guys like me are moving in, and we had education that was empirically more rigorous than the prior generation’s.”

Mr. Skjervem has an M.B.A. from the University of Chicago Booth School of Business, known for teaching that markets are efficient and stock picking is largely a waste of time.

“When you adopt an empirical framework, you expose a lot of storytellers,” he said. “I’m very uncomfortable in the realm of the narrative. I want to listen to the data instead.”

Since Mr. Skjervem joined in 2012, Oregon has shifted about $4 billion out of active funds, or about 15% of the pension plan’s public-equity assets. Eventually, he said, the state may use traditional active management for as little as 20% of its total public stock and bond assets.

Over the past three years, Fidelity, historically renowned for its active management, has launched nearly two-dozen index mutual funds and ETFs, bringing its total passive lineup to approximately 50 funds. Currently 12% of the $2.2 trillion it manages is in index strategies, twice the level five years ago.

Fidelity executives are “trying to help educate the marketplace that there is a difference between all active and good active,” said Tim Cohen, the firm’s head of global equity research. In research released in March, the firm found that among the 25% of all active U.S. large-stock mutual funds with the lowest fees between 1992 and 2015, those from the five largest firms outperformed their benchmarks, on average.

That message hasn’t been an easy sell. “It’s been a tough period for the industry, and flows certainly reflect that,” Mr. Cohen said.

Federal regulations are pressuring investment fees, accelerating the move to indexing, which is an easy way to cut costs. In 2012, the Labor Department started requiring greater fee disclosure in 401(k) plans. The fees on retail mutual funds in large 401(k)s have since fallen by 12%, according to Callan Associates.

In April, the Department of Labor’s new so-called fiduciary rule is scheduled to go into effect. Financial advisers overseeing individual retirement accounts will have to demonstrate that their decisions are in the best interests of their clients, a change that is expected to lead to more fee-based accounts rather than accounts that use commissions with the potential to lure brokers. By using index funds in accounts already bearing an annual fee, brokers can help keep overall costs down.

BlackRock this month said it would lower costs on more than a dozen ETFs in light of the new rule. Morningstar expects the regulation could push as much as $1 trillion into passive investments.

Mr. Bullen, the former Fidelity executive, now manages money for wealthy families and uses a mix of passive and active funds. He also serves on the investment committee of the approximately $480 million endowment of the Whitehead Institute for Biomedical Research at the Massachusetts Institute of Technology.

Though several of the eight committee members are current or former heads of active firms, the committee reached a unanimous decision to cease using active funds for publicly traded securities, according to Mr. Bullen and others.

“The case for passive is being made so well and so clearly,” said Mr. Bullen, “it has become common wisdom.”