Many people ask what is fire? Fire is a chemical reaction, often between different chemical compounds or elements, each which has stored energy. You must have the right kind of mixture in order for a fire to happen. For example, for a fire to occur these items have to come together: heat; fuel; and oxygen. Remove any of them and the fire will not happen.
All of this has to do with chemical reaction that involves electrons. Atoms want to have a complete set of electrons. If an atom doesn't have enough electrons, it can share electrons with another atom. For example, carbon has six electrons. Carbon is in the second row of the periodic table. All the elements in the second row of the period table want to have ten electrons. So where will the carbon atom get the other four electrons? Carbon can share electrons with other elements like hydrogen, oxygen, and nitrogen.
Another way to think of this is that carbon is like a bus with ten seats, and the six electrons of carbon are sitting in six of the seats. Carbon needs to fill up the other four seats. Now oxygen has eight electrons. So it is like another bus with eight filled seats and two empty seats. Now if oxygen and carbon join together, like joining two buses, two electrons from both carbon and oxygen will sit on both buses. The oxygen is now very happy. It has its own eight electrons and two of carbons electrons that run back and forth between the two buses. Carbon, however, is still not happy. It has its six electrons and only two shared riders from the oxygen bus.
So carbon must now find another partner. A second oxygen will join with carbon. Now carbon is happy. It has its ten riders. Carbon has its own six electrons, sharing four electrons with the two oxygens. It gets in return a full bus. It gets four shared electrons from the two oxygens. By the way, this combination of one carbon and two oxygens is known as carbon dioxide.
Carbon dioxide is often given off in a fire. Many things that can burn contain carbon. All living things contain carbon. We say that living things are organic. Things like wood, paper, gasoline, kerosene, and many forms of clothing are made out of organic materials. When a fire occurs, the carbon in the material combines with oxygen in the air giving off heat. Remember that the carbon and oxygen atoms were very unhappy and agitated. Once they combine they are more calm, so they can release the extra energy that they have.
When any matter burns it undergoes a change. There is an energy transfer. According to Albert Einstein's Law of Conservation of Energy: Energy in neither created nor destroyed,
it can only change in form. This is basically what happens when a fire occurs.