BHP Billiton Limited (NYSE:BHP) and Rio Tinto plc (NYSE:RIO) are two of the world's largest miners, but they've taken a big hit along with the rest of the industry as prices for almost all of its products have been on the decline. However, if you take a close look at what's going on, you'll see a brighter future unfolding.

OK, that hurt
Up until 2011, it looked as if China would be using an ever-increasing amount of iron ore, copper, coal, and any number of other commodities. But demand can't grow at an ever faster pace forever. Indeed, China's economic growth has since slowed from double-digit levels as recently as 2010 to just the mid-7% range. To a developed economy, 7% growth is huge. But for an economy slowing from 10%-plus growth, things are cooling off.

The problem is that miners around the world projected China's increasing demand well into the future and started to increase supply around those rosy projections. Once China's demand started slowing, supply easily swamped demand. So even though demand hasn't died, prices are falling because supply and demand are way out of balance.

BHP Chart

BHP data by YCharts

The stock prices of miners have essentially followed the price declines of the major world commodities since the downturn started in 2011. Just look at giants BHP and Rio for confirmation.

Hidden under the pain
The top- and bottom-line numbers show why. BHP, for example, saw earnings fall nearly 40% in fiscal 2014, which ended in June of that year, from their recent peak in fiscal 2011. Rio Tinto, meanwhile, watched its top line fall roughly 20% between calendar year 2011 and 2014. No wonder investors are skittish. With commodity prices still weak, what chance is there for a return to the salad days?

Ah, but this pair isn't sitting still, and neither are other miners. For example, Rio has trimmed its investment in property and equipment by more than 50% since 2012, when it peaked at over $17 billion. And BHP has cut its investment spending by a more modest 20% or so over the same fiscal-year span.

Since its been three or four years since commodity prices peaked in 2011, though, shouldn't things be in balance by now? Not really, because mining projects take a long time to complete. And stopping construction once you've started isn't always the best way to save money. What Rio and BHP have done is refocus around their best projects, mothballing marginal ones.

That said, because the best projects have continued to be developed, production at this gigantic duo has continued to increase. For example, Rio's iron ore and copper production increased 11% and 4%, respectively, last year. These two commodities made up nearly 60% of Rio's revenues and 90% of its underlying earnings. BHP, meanwhile, saw production increase 9% across its entire business year over year between June and December last year, which was the first half of its fiscal 2015.

The end is nigh!
So completing such projects has only exacerbated the supply problem. But remember that steep decline in spending? The big projects are coming to an end, and there hasn't been much spending on new projects to take their place. So, demand, which hasn't gone away, will finally have a chance to catch up to supply.

It won't happen overnight, but it's time to start watching for the bottoming-out process. When prices start to move higher again, Rio and BHP will be ready to take advantage of the upturn. And the numbers that will lead to the commodity resurgence are right there in the financial statements.