Geopolitical tensions have gold and silver back in the limelight, as investors often view them as a safe haven. And high levels of inflation fuel the view that precious metals, as hard assets, can help protect against swiftly rising prices. That's the good news, given that gold and silver have been rallying. But there's another factor to consider when you look at precious metals miners, and if you don't pay attention to it, you could end up getting hurt.

The basic model

Gold and silver mining is a fairly simple business to understand. First, find a place that has material deposits of these precious metals. Then get approval to build a mine. Build the mine. Extract the gold and silver and sell it.

Two people looking at rocks in a mine.

Image source: Getty Images.

Conceptually, that's pretty easy to get your head around. However, building a mine is a long and expensive process with material difficulties possible all along the way. Indeed, there are only just so many places with enough of these precious metals to build a mine and getting approval can be a headache. For example, Barrick Gold (GOLD 1.93%) has been trying to get approval for its Pascua-Lama mine on the Chile/Argentina border for roughly a decade and still doesn't have the final green light. And the cost of building and running a mine is massive. Cleaning up when a company is done with the asset, meanwhile, is also complex and fraught with uncertainty.

Leverage

That said, the cost of a mine, once operational, is something of a line in the sand. When gold and silver prices are close to the line, miners can eke out a profit or dip into the red. But when precious metals prices are materially higher than the cost of production, profits flow swiftly to the bottom line. For example, the gross profit margin for industry giants Barrick and Newmont (NEM -0.12%) has risen dramatically since mid-2019 along with the price of gold. To put some numbers on that, both companies had gross profit margin in the mid-20% range, but Newmont's is now in the mid-30% area while Barrick's is touching 40%.

GOLD Gross Profit Margin Chart

GOLD Gross Profit Margin data by YCharts

Smaller miners tend to benefit even more from high prices, since many have higher cost structures. And yet, in that statement comes the risk. Gold and silver are commodities subject to supply and demand. Rallies are generally followed by pullbacks. When prices fall, the profitability of miners can fall materially, too. That is why investors need to pay close attention to all-in sustaining costs, which is an industry metric that takes into account operating costs and the investment needed to maintain production levels. Lower costs are better because they make it easier to turn a profit.

GLD Chart

GLD data by YCharts

The problem today is that inflation is spreading throughout the world. That means that operating costs for miners are likely to be heading higher. For example, all-in sustaining costs for Gold Fields (GFI -1.08%), another large precious metals miner, rose from $977 per ounce in 2020 to $1,063 per ounce in 2021, a nearly 9% year-over-year increase. 

To be fair, all-in sustaining costs can be impacted by capital spending plans, so investors need to dig in a little to see what's going on. However, with inflation hitting everything from commodities to labor, price increases are a red flag that investors can't afford to ignore. In some ways the rising gold price, which is a major tailwind for miners, is just a sign of this problem. 

Don't get carried away

Wall Street tends to go to extremes, and it is easy to get caught up in the stories that drive the mood swings. Right now gold and silver are being looked at as safe haven assets, providing protection from geopolitical tensions and inflationary pressures. But, on the inflation side, the companies that mine for precious metals are not immune to the impact. If you are investing in gold and silver miners, you need to pay attention to their costs. Not only will rising all-in sustaining costs crimp profitability, they could increase the pain when gold and silver prices fall in the future.