By Gregory Zuckerman and Logan Moore

Pension funds and endowments have been shifting away from the U.S. stock market for years. Some are now reconsidering that decision.

Individual investors, including younger traders using apps like Robinhood, have been playing a bigger role in the market lately. They've been buying up companies including Tesla Inc., Apple Inc. and other technology shares. Large institutional investors like hedge funds and mutual-fund firms have also been buying, pushing the market higher.

After reaching a bottom on March 23, the Dow Jones Industrial Average is up 44% while the S&P 500 has added 45%.

But pensions have been largely moving away from stocks in recent years, a shift that has hurt performance. The median public pension fund managing at least $1 billion had 46.6% of its portfolio in equities, as of June 30, with just a 21.3% allocation to U.S. equities, according to data analytics provider InvestmentMetrics LLC. By contrast, in 2013, the oldest data available, these funds had invested 52.7% of their portfolios in stocks, with 32.1% in U.S. shares.

Now that the Federal Reserve has signaled that interest rates likely will remain low for the foreseeable future, some say pensions are looking to boost their bets on equities. Mika Malone, a managing principal at consulting firm Meketa Investment Group who works with large public pension funds and endowments, says she's having more conversations with clients about moving additional money into stocks.

"It's reasonable to expect a bit of shift toward equities given how unattractive core fixed income is," she says. "We have been discussing low rates in every client meeting."

She adds that most pension funds continue to have a 7% hurdle, or bogey rate. This is the assumed rate of return to meet future obligations and commitments so that police, fire and other government workers can receive payouts and benefits in retirement.

With bonds continuing to return near zero, that rate will be increasingly hard to meet in the coming years.

Unsurprisingly, pensions that have a higher allocation for stocks have been the best performers amid the market rally.

Median annual returns for public pensions for the year ended June 30 were 3.2%, according to Wilshire Trust Universe Comparison Service. But the Nevada's Public Employees' Retirement System and Tampa Firefighters and Police Officers Pension Fund, both with significant stockholdings, returned about 7%.

Steve Edmundson, chief investment officer for Nevada's Public Employees' Retirement System, is well-known for his investing strategy: Do as little as possible, usually nothing. This has helped him avoid the costly fees that have hurt some of his peers. He has also benefited from stocks.

Nevada's asset allocation is largely centered around broad index funds, such as the S&P 500. Overall, S&P 500 stocks account for nearly 42% of its holdings. The fund's overall public equity allocation is 60%. About 28% of the fund is allocated toward U.S. Treasury bonds.

"We emphasize asset allocation first, and try to avoid fees," said Mr. Edmundson. "We consistently implement this over long-term periods and try not to waver."

Holding off on big changes was particularly difficult earlier this year. Nevada's fund was down 10.3% for the first quarter. It rallied 10.9% in the second quarter, according to Mr. Edmundson.

Overall, public pensions lost a median 13.2% in the first quarter of 2020 and gained a median 11.1% in the second quarter, according to Wilshire TUCS.

Among Mr. Edmundson's only moves in the past year: The Nevada pension fund sold $2 billion in stocks at the end of December and reinvested those assets into Treasurys. When the end of March 2020 rolled around, Nevada added $2.6 billion back into stocks near the market bottom.

Interest rates have been low for years, of course, yet pensions and endowments have resisted shifting into stocks. About 85% of global bonds yield less than 2%, as of June 30, according to Lawrence G. McDonald, who writes financial newsletter The Bear Traps Report. Two years ago, 36% had yields less than 2%.

Mr. McDonald says his pension fund clients also are examining shifting out of bonds, partly because yields are so low.

A push into stocks has its own risks. Equity prices are expensive, making some pension and endowment executives wary of dramatic moves in the market. And many remain committed to so-called alternative strategies, like investing in private equity, hedge funds and real estate, which can produce steadier returns.

Overall, funds have an allocation of about 13% in private-equity and hedge-fund investments today, according to InvestmentMetrics.

But hedge funds have underperformed for several years and some big investors may be tempted to shift away from these investment vehicles, some say.

"Private equity may continue to be attractive to many, but it looks expensive, too," Ms. Malone says. "High fees and challenged performance make" hedge funds investments less attractive, another reason some big investors might shift to stocks

Some investors, including Nevada's Mr. Edmundson and Harold J. Bowen III, of Bowen, Hanes & Co., the sole manager of the Tampa Firefighters' and Police Officers' Pension Fund, decry the push into alternatives. Similar to Nevada, Tampa has given priority to stock investments. Also like Nevada, Mr. Bowen was a buyer in March.

"If a situation presents itself, then we won't hesitate to be extremely aggressive," he said. "And so that's what happened in terms of creating activity and reallocating things into some of these areas that we would've moved much slower into."

Mr. Bowen invests in equities by hand picking what stocks to invest in rather than using an index, a strategy that can be dangerous.

In the short term, the strategy has worked, though. Tampa ended the second quarter up 17.1%.

Write to Gregory Zuckerman at gregory.zuckerman@wsj.com