The reason we have coal is some hundreds of millions of years ago there were huge plants that would topple but there was nothing on Eearth yet that could completely digest plant matter. So the biomass would basically stay where it fell and new plants would grow on top of dead ones. This explains the shape of coal deposits.
Some time later I think fungi evolved that could digest cellulose and any plant afterwards would rot rather than get burried. This explains why ALL coal deposits in existence are older than something like 600M years.