300 million years ago, plants, such as ferns and trees, grew in prehistoric swamps. The first step of coal formation occured when those plants died.
Bacteria, extreme temperatures, and pressure acted on the plant remains over time. Eventually, a brownish material, called peat, formed.