Markets and the economy are governed by a combination of cycles and fundamentals. Maybe the most extreme example of this is the coal sector. Over the last decade, coal stocks suffered as the commodity was out of favor due to environmental reasons and the cheap price of natural gas. Most power plants in the U.S. switched to using natural gas as their primary fuel source.

At the same time, the steel sector was quite weak due to oversupply from the previous decade and overproduction in China as state governments looked to support employment. This also negatively impacted the price of metallurgical coal as demand weakened.

Of course, there is also a cyclical component. Due to coal's falling price, many producers went bankrupt and investments in new projects dried up. Even with the recent strength in coal prices, we are not seeing a significant increase in capital expenditures. The catalyst for the strength in coal prices is the rising cost of natural gas and increasingly extreme weather events which is stressing power grids. Thus, many utilities are switching to coal to make up for any gaps in power production. Additionally, the steel sector is also strengthening as the economic rebound increases demand, and China is focused on curbing steel production to reduce emissions.

Thus, it's not surprising that coal prices and stocks have been soaring in recent months. And, another catalyst could be a cold winter which tends to increase natural gas demand and could push coal even higher.

What's even more remarkable is that the gain in prices is completely driven by earnings growth as multiples haven't budged. This is an indication that the market continues to view coal as being in "terminal decline".

For example, Arch Coal (ARCH  ) is up more than 85% year to date. However, it's trading at a very low forward P/E of 6.7 which is nearly a quarter of the S&P 500's (SPY  ) forward P/E. Based on current coal prices, it's expected to generate nearly $20 in free cash flow over the next 12 months which would be equivalent to 25% of its market price. These types of value opportunities are quite rare and indicate that their prospects are going to unravel soon or that the market is completely wrong.

Overall, the recent rally in coal prices shows the impact of cycles and fundamentals on stock prices, and the opportunities that can be found when going against the consensus.