After an animal dies the soft parts of its body decompose leaving the hard parts, like the skeleton behind. This becomes buried by small particles of rock called sediment. As more layers of sediment build up on top, the sediment around the skeleton begins to compactand turn to rock. The bones then start to be dissolved by water seeping through the rock. Mineralsin the water replace the bone, leaving a rock replica of the original bone called a fossil