The Earth was formed about 4.5 billion years ago. In the Hadean Eon a dense atmosphere was formed due to constant volcanic eruptions. The gases present at this time were probably Methane, Carbon Oxides,Hydrogen and water vapour. In the late Hadean Eon, volcanic activity greatly increased the amount of CO2 in the atmosphere which led to liquid water on the earth's surface for the first time.
In the Archean Eon, oceans and other bodies of water started to build up. these bodies of water began to dissolve elements, such as ammonia, from the atmosphere and ammonium compounds and other substances containing Nitrogen formed and helped start life on Earth. The first Algae formed and started to photosynthesise. Methane and Ammonia no longer made up most of the atmosphere. Nitrogen and CO2 were now the main components. In the Proterozoic Eon, a small amount of Oxygen was present in the atmosphere.
The Cambrian explosion is the period in time in which most groups of animals formed. Vegetation covered the surface of the Earth which led to more photosynthesis and more oxygen in the atmosphere. The increase in Oxygen caused the evolution of giant insects ,such as the Arthropleura, during the Carboniferous period.
Mammals evolved and respiration increased the amount of CO2 in the atmosphere.