Photosynthesis requires an energy source (sunlight), therefore the products of photosynthesis (wood, etc) can be thought to contain that photosynthesized energy. When you burn firewood, you are essentially running photosynthesis in reverse, releasing the energy from the sun that the tree went through so much trouble to absorb.
So, fire is cool because it allows us to unleash energy from the sun in small amounts, whenever we please, regardless of when that energy first arrived on earth. In the case of firewood, that energy arrived anywhere from a few years to a few thousand years ago, depending on how long the tree had lived.
|The Llangernyw Yew, a 4,000-5,000 year old tree.|
Fossil fuels originate from dead organisms that were buried underground before they had a chance to decompose (which is why us decomposing them today in our cars/furnaces/etc has global consequences). All the energy from fossil fuels comes from ancient sunlight captured by ancient photosynthetic organisms.
How long ago this energy arrived on earth depends on the type of fossil fuel, but most of the coal we burn today comes from the carboniferous period, which was around 300 million years ago. This idea of the energy we use having an age is presented in the graph below (which I made, yay!). As you can see, most of the energy consumed by the USA in 2009 was harnessed using humanity's first great discovery, fire. In addition, most of that energy actually arrived on earth millions of years ago!
|A Graph of the world's energy sources and when that energy arrived on earth. The circles' areas are proportional to the amount of energy consumed by the USA in 2009. The circles' exact positions are somewhat arbitrarily chosen, though their general position is accurate.|
You might also notice that almost all of the energy we consume comes from the sun, even things you wouldn't expect, like wind and hydroelectric power. Wind is the result of the sun heating the earth's atmosphere unevenly, causing air molecules to move around to even that heat out. Hydroelectric power is harnessed by capturing the energy of water falling from higher to lower elevations. That water gets to high elevations by being heated by the sun. As for nuclear and geothermal energy, those have been around since the formation of the earth ~4.5 billion years ago, and do not originate from solar radiation.
But what is craziest to me is that ancient sun energy that we use!!! You can figure out how long it took ancient plants to absorb all this energy that we are using today by doing a calculation that takes into account how much fossil fuel energy we use, the efficiency of the transformation of ancient plant matter into fossil fuels (very low), and assuming that the amount of plant matter per year made by ancient earth is the same as that of today. The answer that comes out is that we use around 400 years of ancient plant-stored sun energy every year! That sun energy has been sitting around for hundreds of millions of years, and we are using fire to release it at incredible rates all day every day. Wowza!!!!
You might be thinking about how that number relates to our chances of supporting todays global civilization on more recently-arrived sun energy instead of ancient sun energy. The situation is not as bad as that number would make it seem. This is partially due to the fact that both ancient and modern photosynthesis are extremely inefficient processes in terms of the percentage of the total available solar energy that plants absorbs into their bodies (~0.2%). All we have to do is use the sun's energy more efficiently. If we were able to capture and store all of the solar radiation that hit the state of Texas in only 2 weeks, we would be able to power humanity at current energy consumption levels for over a year! We can do it!
|An image of the Sun, meant to instill optimism. Go here for awesome explanation.|