Fire has been known to humans for nearly 500,000 years and was one of the earliest inventions, allowing early humans to cook food. Fire results from a chemical reaction that occurs when molecules meet and exchange electrons, transforming both molecules and releasing heat or light. Some of the earliest fires were stars in the sky.