When Wall Street is afraid, the world is dazzled by gold. That's what happened in August and September when COVID-19 panic pushed gold prices above $2,000 an ounce. Gold outperformed stocks during the volatile year of 2020, with gold prices rising 24.6%, compared with the 18.4% total returns delivered by the S&P 500 index. .

Investing in gold based on your short-term prediction for stocks is sheer speculation. But investing a small amount in gold stocks or funds can be a valuable inflation hedge and portfolio diversifier. Here's when investing in gold makes sense, and why it has nothing to do with what's happening in the stock market.

A pile of gold bars.

Image source: Getty Images.

1. It's been valued throughout human civilization

Global demand for jewelry was down 29% in the third quarter of 2020 year over year, according to the World Gold Council. The drop is largely attributed to the economic devastation of the pandemic, coupled with the skyrocketing price of the precious metal.

But gold has been highly sought after for thousands of years across cultures. The Ancient Egyptians considered it the flesh of the gods. The Incas called it the sweat of the sun. Today, demand for gold jewelry is especially strong in emerging markets, particularly China, where it's frequently gifted for special occasions and the Chinese New Year. It's also valued in India, where wedding season and the festival of Diwali commonly trigger a buying frenzy. These markets accounted for the largest pandemic-related declines.

Still, gold's cultural and historic significance throughout civilization isn't going to be reversed by the coronavirus. You can count on gold holding its value, even if a global recession tanks jewelry demand in the short term.

2. The supply remains scarce

If all the gold mined in human history were melded together, it would fit into a cube of just 21 meters, or 69 feet, on each side. That's roughly enough to fill 3.7 Olympic-size swimming pools. Contrary to popular belief, though, the Earth actually has ample amounts of gold. It's just that mining it is incredibly difficult, and most sources don't contain enough gold to make mining cost-effective. 

Only 0.1% of mine prospects actually get developed into a mine. The exploration and development phases often take a decade or more before gold can actually be mined. Given the complexities of gold mining with current technology, the global supply remains limited, which keeps prices high.

3. It has lower volatility than most other commodities

Investors tend to seek out commodities because they have a low correlation with stocks, so their prices don't move in tandem. Many commodities have returns that tend to move in the opposite direction of the stock market. Commodities are also a common inflation hedge because prices often rise when inflation goes up.  Historically, gold prices have performed better on average in the U.S. when inflation is above 3%. 

But commodities as a whole are highly volatile, given that unpredictable factors like weather, natural disasters, and political instability can drive huge short-term changes in supply and demand. Gold prices can also be volatile in the short term as investor sentiment drives prices up and down, but the metal tends to be among the most stable commodity investments.

Overall, gold demand is pretty constant. Jewelry, which accounts for 50% of its use, tends to be a steady source of demand, though it obviously drops during economic downturns. Central banks and investors, including individuals and exchange-traded funds (ETFs), drive about 40% of demand, though of course this peaks during downturns. Since it's so difficult to discover and develop a gold source, mining activity doesn't respond quickly to price fluctuations, so the supply holds steady.

4. Its industrial usage is limited

Gold has various uses in fields like electronics, medicine, and dentistry. But only about 10% of worldwide gold demand is driven by industrial production. As a result, gold is relatively insulated from a manufacturing recession, even though it's not protected from a consumer recession where spending plummets. By contrast, more than half of silver mined worldwide is used for industry, which is why the white metal is more likely to move up and down with the stock market. 

5. Interest rates are likely to stay low

When interest rates are low, gold often makes sense for those looking for a safe-haven asset because investors can't get much return from other safe-haven investments, like U.S. Treasuries. The Fed has signaled that it plans to keep interest rates near zero through at least 2023. As a result, gold could continue to hold its appeal for several years to come. Once interest rates creep back up, investing in bonds will make more sense for those seeking returns that can outpace inflation.

Should you invest in gold?

Gold may outperform stocks in volatile years like 2020, but the S&P 500 has historically crushed the returns gold delivers over longer holding periods.

^SPX Chart

^SPX data by YCharts.

If you're worried about stocks crashing, staying invested in stocks and committing to a long time horizon is a better strategy than gold. But if you're seeking a short-term bear market hedge, allocating a small percentage of your portfolio to gold can offer some peace of mind. The key is that it's only an effective strategy if you invest before the panic has set in. The worst thing you can do is buy gold when a widespread case of investor nerves has pushed gold to a record high that's likely to be short-lived.

If you do want to invest in gold, owning physical metal could be a hassle. You'll have to deal with delivery logistics, along with storing and insuring the metal. Investing in gold stocks or ETFs that own gold stocks, physical metal, or a combination of the two is much less complicated.

The important thing to remember is that the best time to invest in gold will always be when you're not hearing about the price of gold in the news every day.