Scientists believe the formation of coal is due to the decay of huge plants that once lived in swamp forests. The decay of these huge plants and remains of animals over the years resulted in the formation of some layers, which later turned to coal due to the physical and chemical changes caused by increased temperature and pressure.
However, all the processes that led to the formation of coal happened in the absence of Oxygen. This explanation can also be given to the formation of oil and gas deposits. Also, the process of refining coal must be done in the absence of air. This process is known as the destructive distillation of coal.
The process is done in the absence of oxygen to ensure that more products are obtained. Examples of substances that can be gotten from the destructive distillation of coal are coke, petroleum, coal gas, coal tar, etc.