Development of Earth's atmosphere:
Primary atmosphere: In the first billion years when earth formed. These gases were light, hydrogen, helium, methane, ammonia, and water vapor. There was not enough gravity to hold them down and they escaped into space.
Secondary atmosphere: Gases from volcanic activity (outgassing) released N2, CO2, CH4(methane) , NH3 (ammonia), H2O vapor, sulfur dioxide. As Earth's surface temperature fell and the water vapor condensed, oceans formed. Much of the carbon dioxide and sulfur dioxide became dissolved in the oceans or combined with surface rocks. Oxygen is such a reactive gas that any free oxygen that appeared at early times was removed as quickly as it formed. As solar ultraviolet radiation liberated
nitrogen from its chemical bonds with other elements, a nitrogen-rich atmosphere slowly appeared. Life appeared about 3.5 BYA