The surface of the early Earth was molten for millions of years with no atmosphere
As cooling slowly occured the molten surface began to slowly solidify into land masses
Volcanoes formed on the land masses
Combustion reaction took place while the volcanoes erupted, these released large amounts of carbondioxide and watervapour, as well as nitrogen, hydrogen and other gases like ammonia and methane
When conditions cooled sufficiently, the water vapour later condensed and fell to the surface of the Earth, forming the oceans
How did Oxygen Increase
Primitive plants and algae began photosynthesising which used up carbondioxide from the atmosphere and released oxygen
As more and more plants began to appear the levels of oxygen began to increase which allowed for more complex life forms to evolve
How carbon dioxide decreased
When the water vapour in Earth’s early atmosphere condensed, large amounts of CO2 dissolved in the oceans
Green plants and algae began to evolve and absorbed considerable amounts of carbon dioxide during photosynthesis
Dead organisms turn into fossil fuels, such as crude oil, natural gas and coal which 'locked up' the carbon