When wood burns, it is releasing energy that was stored up over years.
As a tree grows, it takes in sunlight and uses that energy to combine a liquid (water from the ground) and a gas (carbon dioxide from the air) to make the solid stuff of the tree: wood, bark, leaves, and so on. So energy from sunlight is stored in the wood.
We make wood burn by heating it until that solid stuff begins to break down again and release the stored energy. We see that energy as heat and light, which we call fire.