Large amounts of water vapor from erupting volcanoes condensed into cooled down.
About 3.5 billion years ago, after oceans and lake were created, the oceans absorbed a lot of carbon dioxide.
The Earth was created more than 4.5 billion years ago. During the beginning, the atmosphere contained large amounts of hydrogen and helium gas. Majority of them eventually escaped into space
After the beginning of the Earth's formation, the Earth was vert hot and a lot of volcanos were erupting, causing water vapor, carbon dioxide . These gases created atmosphere.
About 2-3 billion years ago, few of the living things began to use the sun's energy to turn CO2 gas and water into sugar and oxygen.
By 600 million years ago, a protective layer upper layer of the atmosphere called the ozone had formed.
About 400-500 million years ago the first land plants appeared on Earth.
Homo sapiens have roamed the Earth for about 200,000 years, during that time, the atmosphere had 78% nitrogen and 21% oxygen
In the most modern atmosphere, the amount of carbon dioxide gas is less then 1%, an increase of 23% from 1959 levels.