The COVID-19 outbreak has thrown global stock markets for a loop, with the Dow Jones Industrial Average (DJINDICES:^DJI) down almost 30% from their recent highs. Those with stock-heavy portfolios are scared to look at their brokerage statements because of the losses they've likely endured.

However, even as stock markets have fallen, another asset class has done well. Many bond investments have gained a significant amount of value so far in 2020, and that's helped those with balanced portfolios with both stocks and bonds hold up better than they would've otherwise. In fact, bonds are doing so well that investors are wondering whether they should add more bonds to their investments.

Bank vault door in silver.

Bonds have a reputation for safety, but they can still lose value. Image source: Getty Images.

Falling yields, rising prices

Bonds are confusing to many investors, and one major source of confusion is how bond prices move. Bond yields have fallen sharply as the Fed has cut interest rates, and it's natural to think that falling yields would make bonds less desirable. However, when bond yields fall, prices on existing bonds rise, because those existing bonds pay higher interest that looks more attractive when prevailing rates on new bonds go down.

You can see below just how much bond prices have gone up:

ZROZ Chart

ZROZ data by YCharts.

The longer the maturity of the bond, the more the bond's price goes up when rates drop. That's why PIMCO 25+ Year Zero Coupon Treasury (NYSEMKT:ZROZ) has seen the biggest gains, up nearly 30% year to date. Meanwhile, iShares 20+ Year Treasury Bond (NASDAQ:TLT) and iShares 10-20 Year Treasury Bond (NYSEMKT:TLH) have seen lower but still impressive returns of 20% and 16% so far in 2020.

What's sent bond prices higher?

Historically, bonds have been a good alternative to stocks during times of trouble. Treasury bonds in particular are backed by the full faith and credit of the U.S. government, so the potential for default is nearly nonexistent. That makes Treasury bonds a safe place to put your money.

However, the returns on bonds lately have come almost entirely from the falling yields that have sent their prices higher. That hasn't always been the case, with the interest that the bonds themselves pay typically being a much more important component of bonds' overall returns. But now, with even long-term 30-year Treasury bonds paying only a bit more than 1% and most shorter-term bonds paying considerably less, just about the only chance for a solid return is to see rates move still lower.

Can bonds keep rising?

Investment experts have made calls for a top in the bond market for years now, and so far, they've all been dead wrong. Bond prices have kept moving higher while yields have hit record lows. In some parts of the world outside the U.S., bond yields have even turned negative -- meaning that bondholders essentially have to pay issuers interest for the privilege to invest in their bonds.

That said, it's important to understand that bond ETFs like the ones above can lose money when bond yields go up. In fact, when Treasury yields rose by just a single percentage point in late 2016, the PIMCO ETF lost more than 20% of its value.

If the rise in bond yields comes because the stock market recovers, then the rise in the stock portion of your portfolio will offset the losses on the bond side. That's the flip side of what those with diversified portfolios have enjoyed lately, and many investors with modest tolerance for risk will be fine with giving up some of the upside from a potential rebound in their stocks if it means having some protection if stocks keep following.

Don't go overboard

If you're looking for some balance in your portfolio, then adding some bond exposure as part of an asset allocation strategy isn't a terrible idea. But for those who are tempted to sell their stocks in order to replace them entirely with bonds, it's likely that you've already missed the lion's share of gains in bonds -- and could end up switching away from stocks at the worst possible time.