If you've paid any attention to the finance news during the last year or two, you know that commodities like iron ore and coal are trading at low levels. That's put the mining industry on the defensive, which is a bad thing for mining equipment makers like Caterpillar (CAT -0.47%) and Joy Global (JOY). But it's also setting two of the best mining equipment makers up for a turnaround.

The bad market
Commodity prices, broadly speaking, peaked in 2011. Since that point in time, prices have mostly been heading lower. The big change in the market was China. This single country, which has been rapidly moving up the socioeconomic scale, accounts for a disproportionately large amount of the world's commodity demand.

The problem is that China's rapid growth has started to cool off. Don't mistake that to mean that China's economy is heading in reverse; it isn't. It's just shifted down to a lower gear.

But the highly cyclical mining industry wasn't ready for that slowdown. Miners across the world ramped up production to meet demand targets built off of China's earlier, and more robust, growth rates. Supply has swamped demand, and prices have fallen.

JOY Chart

JOY data by YCharts.

What do miners do when that happens? They cut spending on everything, including the equipment that Cat and Joy Global sell. This is why both of these giant mining equipment makers have seen their results -- and their share prices -- suffer during the last few years, and Joy more so than Cat because it's more directly tied to the mining space. Cat's diversification, which includes making construction equipment among other things, has been a notable benefit.

Things break down
While this is bad news, don't get too caught up in the negatives. These two equipment makers have global reach, impressive support networks, and great brand names. Their customers are generally loyal because, if something goes wrong, they know who to call. And both Cat and Joy make sure whatever has gone wrong gets fixed as quickly as possible because downtime is lost money for miners.

For example, Cat has nearly 180 dealers in its global network serving every region of the world. Although that number is slightly lower than it was just a few years ago, the number of employees in its dealer network has grown roughly 7% since 2010 to nearly 162,000 people. Now that's a support network that would be hard to replicate. Joy, meanwhile, also has locations around the world, including more than 100 service centers to ensure its equipment keeps running smoothly.

Don't underestimate the competitive advantage that a global service network offers these two mining equipment makers. When a Caterpillar dump truck with a capacity of 400 tons (roughly 800,000 pounds) goes down, a miner's productivity is crimped. To oversimplify things, the more you move, the less it costs to mine.

So miners want their equipment to run all the time and run well. And some of this equipment isn't just about size, its about unique functions -- like Joy's long wall systems. This is the thing that actually breaks up the earth so it can be brought to the surface, and valuable commodities can be extracted. If a long wall mining system stops running, forget productivity being crimped; an entire mining operation could be frozen.

Now that's a big truck. Source: Dionisius Purba, via Wikimedia Commons.

Fading away
But here's the thing: The mining industry is in the doldrums, and miners are cutting spending. That means that big projects are being delayed, curtailing sales for Cat and Joy. And it has increasingly meant that maintenance is being pushed off, too.

But you can only defer maintenance for so long before hard-worked equipment starts to break down. That means more service needs, at some point in the not-too-distant future, which should start to boost results.

New sales, however, will also start to show up because of this trend. While it might make sense to take advantage of used equipment in a downturn, mining equipment is, by the very nature of the business, treated brutally hard. Eventually, a replacement cycle will kick in as older equipment moves past its useful life. That, in turn, will boost sales of new equipment.

And that brings us to the third reason to like Cat and Joy Global: They are strong enough to survive the downturn. Both businesses have reasonable debt loads, and despite the mining industry's travails, have remained profitable. When things start to look better, they will be there to reap the benefits.

If you're looking for the best companies in the mining equipment industry, look no further than two of the largest, Caterpillar and Joy Global.