4.5 B.Y.A the earth was a very different place. Scientists think that the Earth’s atmosphere then. contained sizable amounts of two deadly gases methane and Ammonia. Methane is colorless and odorless just like ammonia except ammonia has a pungent smell. At the time the atmosphere ,the pocket of gas surrounding the earth, was poisonous but contained water vapor aswell
3.8 Billion years ago chemical reactions, a rearrangement of molecular structure, occurred between the 3 elements mentioned before. The reactions were caused by incoming radiant energy from the sun (solar energy) from the sun. As a result of these reactions elements such as Hydrogen, Nitrogen, and Carbon Dioxide were formed .Methane and Ammonia ceased to persist in the atmosphere but water vapor was still present.
200 Million years later as a result of cyanobacteria which are bacteria ( a microorganism) capable of photosynthesis (converting CO2 to Oxyegn), the atmosphere was oxidized which set the stages for advanced life such as humans and animals. Cyanobacteria is an example of anaerobic life. Animals are an example of Aerobic life. 100 million years later Hydrogen escaped the atmosphere due to Earths gravity, a force of attraction to the center of an object's mass, not being strong enough.
This left the atmosphere containing primarily Nitrogen, Carbon Dioxide, and Water Vapor as it's composition or contents. Water vapor was broken down and released more Hydrogen. Oxygen was also broken down as well by solar energy. The byproducts of oxygen was ozone which formed 30km above Earth's surface. This created a defense from the Sun's radiation. The ozone layer allowed life to exist on land not just the ocean. Barely any ultraviolet radiation given off by the sun could get through to damage cells
700 million years ago due to the protection of the ozone , microorganisms popped up on ocean surfaces and on land. Since there was more space for them on land much more photosynthesis occurred. Oxygen was now much more concentrated on Earth's surface.
600 million years ago, Carbon Dioxide and Oxygen levels began to stabilize. and become similar to modern day levels. Present day the atmosphere is 79% Nitrogen, 21% Oxygen, and 1% other. Nitrogen is the most common element because of plant and animal decay as well as Volcanoes and various natural processes