All fossil fuels come from the periods in Earth's history when the Earth had huge tropical forests. In those periods, plants lived, grew and died, faster than they decayed. In other words, they were times when much of the dead vegetation did not entirely decompose. Instead it became coal and related substances such as peat.