The early atmosphere was mainly carbon dioxide and water vapour. Water vapour condensed to form the oceans. Photosynthesis caused the amount of carbon dioxide to decrease and oxygen to increase.
Part of Combined ScienceChemistry of the atmosphere