By Paul Vigna

Stocks have staged a furious rally since bottoming in late March, but bonds are still winning the race for returns this year.

Despite a 47% rise since March 23, the S&P 500 is up just 2.1% in 2020. The Dow Jones Industrial Average is down 4.8% and the Russell 2000 index of small-capitalization stocks is off 12%. Only the Nasdaq Composite has managed a meaningful increase this year, up 22%, because of a surge in a handful of big technology stocks.

Government-bond yields, meanwhile, have dropped to historic lows as prices have risen and investors have scrambled for havens in the midst of the coronavirus pandemic. The Fidelity U.S. Bond Index Fund is up 7.1% this year, while the iShares U.S. Treasury Bond ETF has risen 9%.

The problem for bond investors? The gains, much like those of equities, have been driven by Federal Reserve monetary policy, which has steadily driven yields down since the financial crisis of 2008. The question is whether, with rates so low, investors can still count on the combination of safety and performance that bonds are known for offering.

"It's more normal than many people assume" for bonds to outperform stocks, said Scott Mather, who manages Pimco's $70 billion Total Return Fund, which is up 7.8% year to date. "People don't understand you can do pretty well in bonds."

Over the past two decades, the average annual return on the S&P 500 is 4.25%, according to Dow Jones Market Data. With dividends, that return rises to 6.32%, just outpacing the Total Return Fund's annual average of 6.07% since the start of 2000. Meanwhile, investors who bought a 30-year U.S. Treasury bond in September 2000 received a 5.70% interest rate -- and will be enjoying that yield for another decade, too.

Yields, though, are now flirting with record lows, hovering below 1.5% for the 30-year and around 0.66% for the 10-year. For many investors, that is an argument for the "TINA" trade, a bet there is no alternative to stocks when the yield on the S&P 500 sits at 1.71%.

Who is still buying government debt at those levels? The Federal Reserve last week released its flow of funds report for the second quarter, which breaks it down.

The largest domestic holder of U.S. government debt was the Federal Reserve itself, which had about $4.8 trillion of Treasury bonds as of June 30. That was followed by retirement plans run by the federal government, which held about $4 trillion.

Households and nonprofit organizations held about $1.7 trillion.

Among other big holders were money-market funds with $2.3 trillion, mutual funds with $1.2 trillion, U.S. banks with about $930 billion, private pension plans with about $700 billion and state-run retirement plans with $337 billion.

Despite falling yields, the core thesis for buying bonds hasn't changed, Mr. Mather said. Investors turn to bonds for steady income and capital preservation, as a hedge against volatility in the stock market and to keep pace with inflation.

With the Fed dedicated to driving inflation higher and keeping rates lower, bond investors seeking a higher return should think more like stock investors, said Adam Koos, president of Libertas Wealth Management Group.

For clients interested in bonds, he buys mutual funds or exchange-traded funds. As opposed to owning bonds directly, funds can and do lose value. He also recommends other techniques including hedging against declines and even shorting the bond market at times.

"Savers, especially older folks, are going to find out the hard way, bonds aren't so safe anymore," said Mr. Koos, whose investment firm in Columbus, Ohio, has about $68 million in assets under management.

Still, Mr. Mather says the conditions are prime for the bond market's run to continue, pointing to the possibility of lower inflation or an extended economic downturn that forces the Fed to unveil additional stimulus.

"It's not unrealistic for another year or so of good returns," he said.

Write to Paul Vigna at paul.vigna@wsj.com