Fire is an exothermic chain reaction. It is called exothermic because it produces heat and is called a chain reaction because when one fuel source catches fire, it spreads continuously until all the fuel is burned up. Fire-safety experts often talk about the fire triangle — really a list of three things fire requires: oxygen, heat and fuel. No matter what fuel is burning, oxygen is always one of the main "ingredients" in fire.
Any fuel source, be it paper, gunpowder or gasoline, has a certain amount of stored energy in it. This energy cannot normally be released because it requires something called activation energy. Most combustible materials need to be heated (or in the case of some explosives, struck) to give them enough energy to start an exothermic chemical reaction. Without this needed energy, the fuel cannot react with oxygen to start fire.
When a fuel source is hot enough, fire begins. The fuel reacts with nearby oxygen, releasing energy and producing ash and gasses. As most fuels contain carbon, carbon dioxide and carbon monoxide are almost always produced by combustion. Various other molecules such as water, nitrous oxide and even sulfuric acid can be produced depending on what is in the fuel. Some of the energy is released as light, which is what you see when you look at a fire. Most of it, however, is turned into heat. This heat, in turn raises the temperature of nearby molecules of fuel enough that they too can react with oxygen, producing more heat and continuing the cycle. So long as there is heat, fuel and oxygen to burn, the fire will continue.
The Earth's atmosphere actually doesn't contain all that much oxygen. In fact, it is mostly made up of nitrogen - almost 80%. Only slightly more than 20% of the atmosphere is made out of oxygen. Because fire needs oxygen to burn, the amount of oxygen available to it controls the rate at which it burns. If fire is exposed to pure oxygen such as from an oxygen canister, combustion speeds up dramatically, and there may be an explosion. This is why pure oxygen is viewed as a fire hazard; it makes normal fuels burn much more quickly and easily, potentially causing fires to burn out of control.