the early atmosphere was created about 5 billion years ago by extreme amounts of volcanic activity releasing co2, water vapour and nitrogen.
as the atmosphere cooled, the water vapour condensing into rain, collected into hollows in the solidifying magma forming the first oceans. the atmosphere then started to stabilize formed of mainly co2 with traces of methane and ammonia.
around 3.5 billion years ago organismns similar to bacteria could use the breakdown of chemicals as a sorce of energy. then 2.7 billion years ago alge which use the suns energy formed
the organisms thrived removing co2 and making oxygen they began to evolve forming land plants and finally animals which lived on the plants and respired (breathed) the Oxygen they created.
as these animals evolved more and more complex creatures were created including humans which shaped the atmosphere simmular to what we are seeing today.
modern day atmosphere is 78% nitrogen 21% oxygen and 1% carbon dioxide, argon, ammonia, methane and ozone.