What type of rock are they found in.
Types of rock that normally lack fossils are metamorphic rocks (formed from sedimentary rock under heat and pressure), and igneous rocks(the result of molten or volcanic rock that later cooled).
How are they formed.
Fossils are formed in a number of different ways, but most are formed when a plant or animal dies in a watery environment and is buried in mud and silt. Soft tissues quickly decompose leaving the hard bones or shells behind. Over time sediment builds over the top and hardens into rock.
Example of how they are formed.
So how are fossils formed anyway? There are several processes that plants and animals or their parts can be preserved. No matter which way preservation occurs it takes a lot of luck, pure happenstance. Most living things are quickly recycled upon death. Scavengers and bacteria usually consume all but bones and shells.