Rocks form the basis of the Earth's surface and have been present on Earth longer than humans. There are three main types of rocks - sedimentary, metamorphic, and igneous - which are distinguished by their formation process. Sedimentary rocks form from compression of soil and sediments and may contain fossils. Metamorphic rocks form from changes to existing rocks through heat, pressure, and chemical activity. Igneous rocks form from cooling lava or magma, and their grain size depends on the cooling rate at their formation site.