About 300 million years ago, earth had many dense forests in low lying wetlands. Due to natural processes the forest got buried. They were compressed when more soil deposited over them. As they sank deeper and deeper temperature also rose. Dead plants slowly converted into coal under high pressure and high temperature.