Coal is formed from the remains of ferns and trees, if these die in marshy wetlands then they do not decompose which could be due to a lack of oxygen or acidic conditions. These both prevent bacteria from carrying out decomposition. Over time, the plant remains covered with sediment and compressed, high temperatures and pressure creates coal.