When the Earth was formed around 4.5 billion years ago there was probably no atmosphere. It is believed to have come into existence as a result of the volcanic expulsion of substances from the planet's interior, ejecting mainly water vapour, with some carbon dioxide, nitrogen and sulphur. The atmosphere can only hold a certain amount of water vapour, so the excess condensed into liquid water to form the oceans.
It is thought that the first stage in the evolution of life, around 4,000,000,000 years ago, required an oxygen-free environment. At a later date, primitive forms of plant life developed in the oceans and began to release small amounts of oxygen into the atmosphere as a waste product from the cycle of photosynthesis, as shown by the following equation.
H2O + CO2 CH2O + O2
This build-up of atmospheric oxygen eventually led to the formation of the ozone layer. This layer, approximately 8 to 30 km above the surface, helps to filter the ultraviolet portion of the incoming solar radiation spectrum. As levels of harmful ultraviolet radiation decreased, plants were able to move to progressively higher levels in the oceans.
This helped to boost photosynthesis and thereby the production of oxygen. Today, this element has reached levels where life has been sustainable on the surface of the planet through its presence, and it should be remembered that oxygen is an element which is not commonly found in the universe.