What happened

Shares of Peabody Energy (BTU -0.48%) were dropping 4% on the day as of 9:50 a.m. ET Friday. Yet the coal stock is still up a solid 15% so far this week as of this writing, according to data provided by S&P Global Market Intelligence.

You can thank commodity prices (and it's not just coal that I'm referring to here).

So what

Newcastle coal prices, which are also the benchmark for the Asian market, rocketed this week to above $400 per metric ton and are barely $20 away from record highs as of this writing, according to data from TradingEconomics.com. The figure is also a key global benchmark for coal prices as China and India are the world's largest consumers of coal.

A miner working at an underground mine.

Image source: Getty Images.

At the same time, oil prices continued to rise, while natural gas prices hit 14-year highs of $9 per million British thermal units (MMBtu) midweek.

That astounding rally in prices of fossil fuels, particularly natural gas, is the biggest factor that drove prices of coal and coal stocks like Peabody Energy higher these past few days.

The war between Russia and Ukraine has disrupted the energy market and driven prices of fossil fuels so much that power companies have been forced to fall back on using coal. Warmer weather in parts of the world has exacerbated the situation. India, for example, is facing a heat wave and an acute shortage of coal, so much so that the country -- which intended to ban coal imports by 2023-2024 -- is now penalizing power companies that aren't importing coal to fill the domestic production gap for electricity!

It's the perfect setting for Peabody Energy, the world's largest coal producer that isn't government-owned.

Now what

In its last quarter, Peabody Energy's revenue from coal surged 58% year over year, driven almost entirely by higher coal prices. With prices rising further, the numbers next quarter should impress as well.

To be sure, most nations across the globe still want to phase out coal as they switch to cleaner fuels, but perhaps not so soon now that prices of fossil fuels are making them unaffordable for many. In short, coal has gotten a renewed impetus, and as long as it remains so, market participants will likely continue to bid Peabody Energy shares higher.