The early earth's atmosphere was theoretically formed by intense volcanic activity, which realeased gasses that made the early atmosphere. These gasses are similar to present Venus and Mars and they include:Large amounts of carbon dioxide \little or no oxygensmall amounts of other gasses
The earth eventually collided with Mars forming the Moon. After this collision with mars, the Earth was molten but after it began to cool down, water vapor condensed into water. It took centuries for oceans to form.
Carbon dioxide is a very soluble gas and it dissolves readily in water. As oceans formed, carbon dioxide dissolved, forming carbonate compounds so its amount in the atmosphere decreased. Carbonate compounds eventually precipitated as sedmientary rocks.
After oceans formed, algae first evolved approximately 2.7 billion years ago and soon after, oxygen began t exist in the atmosphere. Photosynthesis by algae released oxygen , which gradually built up in the atmosphere. Eventually, the oxygen allowed animals to evolve.
Coal is a fossil fuel which was formed from trees which were in dense forests in low-lying wetland areas. Flooding caused the wood from these forests to be buried in a way that prevented oxidation taking place. Compression and heating over millions of years turned the wood into coal.
Crude oil and natural gas were formed from simple plants and tiny animals which were living in oceans and lakes. These small organisms died and their remains sank to the bottom where they were buried under sediments. The lack of oxygen prevented oxidation from occurring.