Atmospheric CO2 comes from Volcanism.
It is released in Mid-Oceanic
Ridges (upwelling mantle) and in subduction zones. Early on, there
was much volcanism, thus a lot of CO2 was put into the
early Earth atmosphere.
CO2 is removed from the atmosphere via Photosynthesis from
plants, but the Ocean and carbonate sediments are the greatest
reservoir for CO2.
Moving back and forth between the Atmosphere
and in the form of Carbonates is controlled mostly by the current
temperature of the Earth.
This cycle has been going on since the beginning. If the Oceans are warm, the CO2 more readily precipitates out in the form of carbonates. This allows still more to be removed from the Atmosphere. However, if you reduce CO2, the earth cools due to reduced 'greenhouse' effect. Conversely, cool oceans precipitate out less CO2 in to carbonates, which keeps atmospheric levels of CO2 high and strengthens the greenhouse effect!
In this way, the oceans and volcanism kept the Earth at a very similar temperature, allowing for liquid water (not too hot, not too cool), even in the first billion years when the Sun was not as bright. Burning of fossil fuels has changed this balance in recent years, and may be leading to a heighten recent warming.
See the American Geophysical Unions recent position on this issue here.