Volcanic eruptions released gases from within the Earth that collected in the atmosphere over millions of years to form the air we breathe. As the young planet cooled, thick clouds developed and heavy rains formed the oceans, which absorbed much of the carbon dioxide. Tiny ocean plants then began producing oxygen through photosynthesis, enriching the atmosphere with the nitrogen and oxygen that now dominate air and support life.