Fossils form when a dead animal or plant is covered by sediment. Eventually, the organic matter in the bone or plant, such as the blood vessels and tissue, slowly turns into rock, which becomes known as a fossil.
According to How Stuff Works, the process of fossilization takes place over millions of years. Usually, the process begins when an animal or plant dies in a place with moving sediment, such as the benthic zone. This is the deepest part of a body of water, and animals, such as dinosaurs, that fell in this zone were quickly covered by sediment. The sediment protected the dinosaurs' bodies, which eventually decomposed, leaving the bones, teeth and claws intact.
When fossils form, the organic parts of the bone, such as the blood vessels, collagen and blood cells, break down; only the inorganic parts of the bone, or the parts of the bone made from minerals like calcium remain. With the absence of the organic material, the bone becomes fragile and porous much like a sponge. Then, slowly the bone begins to fossilize as ground water brings other minerals like iron and calcium into the bone. These minerals precipitate into microscopic pores, which makes the bone more rock-like. The process is similar to filling a sponge with glue. The minerals fill in the pores of the bone, making it stronger and sturdier. Over the course of millions of years, the sediment surrounding the bone becomes sedimentary rock, after layers and layers of sediment have settled. Eventually, a natural process like an earthquake or the Earth’s gradual shifting reveals the fossils contained within several layers of rock.