Image source: BHP Billiton.

BHP Billiton Limited (BHP -2.50%) rose 15% in September. Rio Tinto plc (RIO -1.03%) advanced 10%. Even beleaguered Vale SA (VALE -2.51%) was up, though only about 4% or so. But, on the whole, it was a good month for some of the world's biggest miners. That continues a year long trend; Here's what's going on.   

What happened

The truth is that nothing huge changed in September. But there was a big shift in sentiment around the middle of the month. Between Sept. 13 and Sept. 30, BHP rose nearly 18%, Rio Tinto jumped 12%, and Vale advanced 11%. Clearly, it was that last little kick that led to the solid full-month gains for this trio.

September merely extended that full year run. Through the first nine months of 2016 Vale is the standout, advancing nearly 75%. BHP and Rio trail well behind with still substantial nine-month gains of 36% and 17%, respectively. For reference, the S&P was up around 7.5% over that span. Clearly it's been a good year overall. The biggest story behind the relative strength of the major miners has been solidifying commodity prices.   

Image source: BHP Billiton.

Vale's shares, it's worth noting, are also recovering from a particularly hard hit following a mining accident at a Brazilian facility jointly owned with BHP. Vale took the larger hit because, unlike BHP, it counts Brazil as its home market, which opens it up to larger legal issues. So you have to take Vale's impressive 2016 gains with a grain of salt.

So what

The thing is iron ore, which is the biggest contributor to results at all three of these miners, started to fall in the early days of September. That clearly wasn't good news. However, as the month wore on, it became increasingly clear that demand for foreign iron ore in China was remaining fairly robust. And that's a very big deal.   

BHP Billiton generated roughly 42% of its revenues from China alone in fiscal 2016, which ended in June. However, a full 61% of the miner's iron ore sales went to that country. Rio Tinto, meanwhile, generated 42% of its revenues from China in the first six months of 2016, up from 36% in the same span last year. Vale, despite operating its largest mines on the other side of the world, generated 40% of its revenue from China in the second quarter, up a couple of percentage points from the same period last year.   

Basically, Chinese demand is very important. And so is iron ore. Fully a third of BHP's revenues were generated from selling iron ore in its just ended fiscal year. The metal made up roughly 60% of Rio Tinto's commodity revenues in the first half of the year... And just about 80% of the operating profit of its commodity business. For Vale, the company's ferrous metals group accounted for 68% of the top line. You get the point, iron ore is a huge deal for these miners.   

So with demand for this trio's most important product appearing to remain robust in its most important market, China, it makes sense that investors were willing to support the shares.   

Image source: Vale SA.

Now what

No one has a crystal ball, particularly when it comes to commodity prices and demand. So investors shouldn't get too excited about BHP, Rio Tinto, or Vale at this point. All three have had a nice run, but commodity prices and demand need to keep moving in the right direction if the stocks are going to hold these gains or further their advance.

That said, if you believe the worst has passed for the mining group, you might want to take a deep dive here. Remember, of course, that while iron ore and China are big stories for each company, neither is the complete story. For example, oil has been a positive for BHP lately and Vale is in the middle of a huge, and costly, iron ore project. In other words, September was a decent month but you'll want to do a lot more work before you jump in here.