On Earth, the local earth's atmosphere is rich in nitrogen (78.1%) and oxygen(20.9%), with small amounts of argon (0,9%), carbon dioxide (variable, but around 0.035%), water vapour and other gases, and protects life on the planet by absorbing ultraviolet radiation of the sun, and reducing the temperature difference between day and night.
The evolution of the earth's atmosphere
Originally the earth's surface was molten meaning that any atmosphere was very unstable. After many billions of years a crust formed, still heavily populated with volcanoe?s shooting steam, carbon dioxide and ammonia in to the air. At this time the atmosphere was mostly carbon dioxide with virtually no oxygen.
After billions of years the water vapour condensed to form oceans, which started to dissolve the carbon dioxide. Green photosynthesizing plants evolved over the surface of the earth converting carbon dioxide in to oxygen and locking the carbon in to [fossil fuel]?s. Carbon was also locked in [sedimentary rock]?s. As more oxygen was released in to the atmosphere it reacted with the ammonia releasing nitrogen gas. Ammonia was also converted in to nitrogen gas by nitrifying bacteria.
As more photosynthesizing plants appeared the levels of oxygen increased dramaticly - actually killing earlier plants which couldn't handle it and encouraging the growth of more complex organisms. The appearance of the [ozone layer]? further favoured these new plants by protecting them from harmfull ultraviolet radiation. At this time the carbon dioxide levels became very low - as it remains today. The recent burning of fossil fuels on these levels has had a controversial effect, which some fear could cause a increase in global warming.
See also: [Ozone layer]?, Stratosphere?, ionosphere, Kennelly-Heaviside Layer