The Earth started with no atmosphere 4.2 billion years ago. 4 billion years ago, volcanoes produced 5 gases: water vapour, carbon dioxide, nitrogen, hydrogen and ammonia. The ammonia reacted with water vapour producing more nitrogen. The nitrogen slowly increased and stayed in the atmosphere because its very unreactive. oxygen was produced from algae as a product of photosynthesis. As algae evolved to be bigger, more oxygen was produced. The oxygen levels on the Earth has rapidly increased from a trace to 21%. The nitrogen levels have exponentially increased from 3% to 78%. -(Friend)