Have you ever wondered over the question in title 🤔 Cause we all know that coal is formed due to decaying of wood into peat but we also know that it gets decomposed and converts to manure due to fungi and bacteria so how come we've so much coal.
Here comes the Carboniferous Age . During this age plants developed wood fiber known as lignin and bark sealing waxy substance suberin. The animals and fungi at that time hadn't developed enzymes to decompose these. This lead to large deposits of wood, which accumulated long enough to be fossilised on a large scale.
And thus the coal deposits.
Source : Carboniferous - Wikipedia
Pic Credits : Wikipedia