The primordial atmosphere
Today, our atmosphere is composed of about 21% of oxygen, 78% of nitrogen, and 1% of small quantities of various gases: argon, neon, hydrogen, etc. But it has not always been so! It is estimated that Earth's primordial atmosphere - about 4.5 billion years ago - was mostly composed of hydrogen, nitrogen, carbon dioxide (CO2), ammonia (NH3) and methane (CH4). No oxygen, therefore! Or in very small quantities, of the order of only 0.0001%.
Therefore, we are talking about the absence of O2 gas , at that time. Paradoxically, the oxygen atoms were all there, and they were even among the most abundant elements on earth. But for the most part they were linked to carbon to form CO2 or trapped in rocks of the crust and mantle.
Cyanobacteria were the first to invent photosynthesis as we know it. From CO2, water and solar energy, these bacteria - sometimes also called blue-green algae - were able to capture the carbon in the CO2, while rejecting oxygen! Unlike plants (which convert mineral nitrogen into organic nitrogen) and animals (which convert organic nitrogen into another organic nitrogen), cyanobacteria (and a few others) are able to take nitrogen directly into the air, gaseous form, and turn it into organic nitrogen. They thus put 100 million tons of mineral nitrogen a year at the disposal of plants on the planet.
All this changed with the appearance of life about 3.5 billion years ago. A key element of life as we know it, is the ability to produce organic carbon molecules (such as carbohydrates, proteins or lipids), which serve as sources of energy. To make them, living organisms have to find carbon. The first bacteria found their carbon by picking up what came within their reach as nutrients (humans do the same). But about 2.7 billion years ago, a new type of bacteria appeared: cyanobacteria.