Fossil fuels and minerals form from ancient biological materials over millions of years. Coal forms from decaying plant matter that is buried and subjected to heat and pressure deep underground over long periods of time. This transforms the biological material into coal. Oil and natural gas form in a similar manner from the remains of tiny marine organisms. Minerals form when elements and compounds crystallize from molten rock or are deposited by water. For example, iron ore forms as iron-bearing minerals crystallize from lava or are deposited by groundwater.