Fossils are primarily found in sedimentary rocks because these rocks form at low temperatures and pressures. Igneous rocks form at temperatures and pressures that are high enough to destroy any organic remains. On rare occasions, fossils are found in metamorphic rocks, but they are deformed by the heat and pressure.
The majority of fossils are found in layers of sedimentary rock formed by silt or mud. When an organism dies in an area where its body is protected from scavengers and the elements, its remains are often buried by sediment. Over time, as the sediment is compressed into rock, the remains of the organism decay and dissolve. Minerals seep into the bones and change their chemical makeup. In other cases, the skeleton disintegrates entirely, leaving only a cast that is filled with minerals.
Igneous rocks form from magma at temperatures that are too high for any organic remains to survive. Any organism that is caught in magma is disintegrated and cannot fossilize. Metamorphic rocks are formed from sedimentary or igneous rocks that are heated and subjected to high pressure. If these sedimentary rocks contain fossils, these may survive the metamorphic process. However, the fossils are severely deformed and distorted by the pressure and heat.