The atmosphere is actually 0.041% carbon dioxide (CO2) or ~410 parts per million (ppm). That number is going up as a consequence of human activities, but it has varied in the past. For instance, over the last 800,000 years, CO2 concentrations have been as low as ~180 ppm and as high as ~300 ppm during the Eemian interglacial that began around 130,000 years ago. The last time carbon dioxide was around 400 ppm was about 3.5 million years ago during the mid-Pliocene.
The reason the CO2 has varied in the past is due to natural processes tied to ocean and biosphere storage of carbon, the weathering of rocks, and volcanism.
With regard to oxygen, it is very interesting that we actually have any in our atmosphere at all. Our atmosphere was not oxygenated until about 2.4 billion years ago, more than 2 billion years after our planet was formed.
Oxygenated atmospheres are very rare. There are no other planets with oxygenated atmospheres in our solar system and likely very few in other solar systems. Why? At least on our planet, oxygen in our atmosphere is tied to the presence of life. Photosynthesis and other metabolic processes are thought to have begun the oxygenation of our atmosphere 2.4 billion years ago, but the original concentration of oxygen was probably only a few tenths of a percent.
The oxygen-rich atmosphere that we enjoy today was not established until several hundred million years ago. This was again tied to changes in the complexity of our biosphere, that may have in turn been tied to the establishment of enough ozone in our upper atmosphere to shield life from the harmful effects of UV radiation.
Help fund climate research by Earth Institute experts here. The more we know, the better we can protect our planet.