The first forms of life were simple, one-cell (unicellular) microbes from
chemicals that were in the environment (the Miller-Urey experiment suggests
that chemical constituents of the time, combined with a spark or other high
energy source created the primitive amino acids that are necessary to build
a living organism). Microbes are organisms smaller than one can see with
the naked eye. These early microorganisms "ate" food from existing
chemicals in the environment and soon depleted these chemicals. They also existed
in an oxygen-less environment, hence the name "anaerobic" lifeform.
Another form of life evolved about 2.5-3 billion years ago: organisms that could manufacture "food" from inorganic substances in the environment. A particular type of organism, the green plant (actually, the earliest forms were cyanobacteria, once known as "blue-green algae"), stored the energy of sunlight in the organic compounds it produced from carbon dioxide and water, in a process called green plant photosynthesis. The importance of this event about 2-2.5 billion years ago was that a by-product of this type of photosynthesis is oxygen (O2) gas. This became the major source of atmospheric oxygen.
Unfortunately, anaerobes are harmed
by oxygen, so a massive die-off took place. This constituted the first major
(air) pollution event, where oxygen was the pollutant! It wasn't really
air pollution, since life was not living out in the air yet; but if they were
on dry land, they would have been killed by the oxygen now accumulating in the
atmosphere.
With the build-up of atmospheric oxygen, another form of life could evolve
about 2 billion years ago, the aerobe. Aerobes use up oxygen, and give
off carbon dioxide as a waste product. This produces a synergistic relationship
between the green plants and the aerobes, where each supplies the other an important
gas for its life while giving off a waste that is used by the other organism.
This cycle reached a steady-state equilibrium, which is tough to break (with
such a strong synergism, it's tough for any other organism to divert significant
CO2 and/or O2 resources out of the loop).
At the same time, the atmospheric
oxygen (O2) could absorb short wavelength ultraviolet radiation in sunlight,
keeping it from reaching the ground, where it would kill lifeforms that ventured
out onto dry land. The stratospheric ozone (O3) layer also formed from
the photochemical reaction involving oxygen (O2) absorbing ultraviolet radiation. The semi-permanent
ozone layer finally allowed life to leave the oceans and evolve on dry land,
by blocking the ultraviolet radiation that was not being absorbed by the O2 in the atmosphere.
Minor
outgas products from the Earth included molecular nitrogen (N2) and
ammonia (NH3). Before oxygen became a major constituent of the Earth's atmosphere,
ammonia absorbed some of the solar ultraviolet radiation, broke up into component
atoms, and recombined into other compounds, including molecular nitrogen.
After lifeforms evolved, anaerobic bacteria reacted organic compounds with nitrates occurring in the environment and within their bodies. This chemical process is called denitrification and was the source of most of the atmosphere's molecular nitrogen.
Because molecular nitrogen is fairly
unreactive in the Earth's atmosphere, so it has a very long lifetime, and the
source rate of nitrogen from denitrification was greater than the removal rate
of nitrogen in the early days, the nitrogen content of the atmosphere built
up to a very high mixing ratio over the next few billion years.