What is fossil fuel? There is more than one type - fossil fuels are generally classified into peat, coal, oil or natural gas. These fuels are considered to be the result of bacterial decomposition of major amounts of organic matter (plants and trees) under temperature and pressure from tons of rocks pressing down over a very long time. The process is complicated and varies.
Fossil fuels are also called hydrocarbons, based on their chemical content. Fossils and fossil fuels are mostly found in rocks, and may date back hundreds of millions of years. This clearly makes fossil fuels pretty hard to replace once used up. So, they are also known as non-renewables.
Peat: Peat may be called a low grade coal. Peat is the result of biochemical action on many layers of plants. The plants are buried by sediment. The decomposition is incomplete.
Converting Coal to liquid fuel:
You can convert coal to an oil substitute as has been done in WW II Germany and South Africa.
Using a Bergius direct hydrognation reactor you can get 6.2 barrels (260 gallons) of liquids from one ton of coal.
Converting coal to liquid continuously on a large scale is however complex, expensive, water intensive and unlikely to replace oil anytime soon.
Coal: If the peat is further heated and compressed by many tons of rock, it will slowly metamorphose into a rocklike substance called coal. There are four grades of coal: brown lignite coal, black sub-bituminous and bituminous coal, and finally hard anthracite coal. The energy content increases from lignite to anthracite.
Oil: Oil formation is similar to coal, but more complex. Oil needs to be formed in a nearby marine environment where plants and animals are deposited. The digestion process is anaerobic, meaning without oxygen. As with coal, this mix is exposed to temperatures and pressures, but not as extreme and not as long a time. Tiny fossils called foraminifera are used to date and track oil and gas deposits.
NOTE: There are non-organic (Abiogenic petroleum origin) theories of oil formation. However, this would make the oil something other than a fossil fuel. Inorganic theories are not discussed here.
Natural Gas: Natural gas formation is similar to coal and oil. Buried plant and animal matter are transposed by microorganisms, temperature, and heat into methane, a gas. The light weight of methane means it rises until it is trapped.
In defining what is fossil fuel, one should include the interesting and abundant fossil fuel known as methane clathate, or methane hydrate. Clathrates consist of ice crystals trapping hydrocarbons. Literally, they may be described as burning ice. Their abundance may be as much as 10 times current natural gas reserves! However, extracting hydrates is a whole other science.