Gasoline is made up of hydrogen and carbon atoms arranged in chains. Burning gasoline in the presence of oxygen converts it to carbon dioxide and water, releasing energy.
Gasoline is actually a mixture of a large variety of liquid hydrocarbons derived from the distillation of crude oil. It is highly flammable when oxygen is present. When gasoline is burned, chemical bonds are broken down into more stable, lower-energy bonds in an exothermic reaction that releases significant amounts of energy.
Most of the gasoline produced in the world is used to run internal combustion engines. In an internal combustion engine, a mixture of gasoline and air is sprayed into a chamber. A piston slides into the chamber, compressing the gas-air mixture. A spark plug creates an electrical spark that ignites the gasoline, releasing heat. The hot gases in the cylinder expand, forcing the piston back down again. The exhaust valve opens, allowing exhaust to vent, and the process begins again. The up-and-down motion of pistons repeatedly rising and falling is converted to rotational motion by the crankshaft. By burning gasoline in many small bursts instead of all at once, the explosive energy of the fuel is released in a controlled and relatively safe manner.