What happened during the first billion years of the Earth's existence?
there was intense volcanic activity that released the gases that formed the early atmosphere and water vapour that cooled and condensed to form the oceans.
When the oceans formed carbon dioxide dissolved in the water and carbonates were precipitated producing sediments , reducing the amount of carbon dioxide in the atmosphere