Answer:

Coal is formed in peat bogs that get buried and layered over by other rock (usually sedimentary rock). Add some heat and pressure and voila, a few million years later you get coal. This is pretty certain since caol can get followed all the way from rotting plants in peat bogs to antracite and beyond. All of it burns and has remains or fossils of the plant life (and sometimes creatures)within it.

Oil (and natural gas) is is a bit more difficult to explain. Although the same biological are sure to account for most of it, there are some puzzles that point to a non-biological origin for at least some of it. For example, you can extract helium from only a few wells, and no animal or plant seems responsible for it.

Look up Thomas Gold's paper on the abiotic origins of oil:

http://en.wikipedia.org/wiki/Thomas_Gold

First answer by Eric M Jones. Last edit by Eric M Jones. Contributor trust: 885 [recommend contributor recommended]. Question popularity: 8 [recommend question].