Coal is generally found in ground whereas petroleum is found in the seas. The theory of coal and petroleum formation are as follows:
Formation of coal - In the swampy areas when plants and animals died, they sank deep and with the passage of time they were covered with soil, rocks and dead matter of other organisms. Slowly, a large pile gathered on the dead matter and due to constantly high pressure and temperature for millions of years the dead matter converted into coal.
Formation of petroleum- In the sea when plants and animals died, they settled down at the bottom of the sea. With the passage of time more dead plants and animals settled forming a pile which kept on increasing. By the action of pressure and temperature for millions of years, the dead matter changed into petroleum.