how was coal initially formed

how was coal initially formed