When plants died, they fell to the ground.
They became buried in water and mud.
Over time, the dead plants went deeper into the ground.
They were compressed under soil and rock.
The heat from underground slowly changed them.
After millions of years, these buried plants turned into coal.