The earth (and all planets in our system it seems) are created from hydrocarbons. Originally, there was no atmosphere. Hydrogen moving towards the surface through the mantle may have combined with oxygen molecules to create water. Which is why aquifers are found throughout the world, even under deserts. Even methane, which is CH4, is created in the mantle. Methane has been found on many planets and their moons. Natural Gas is 95.2% methane. Coal is the solid form and petroleum the liquid form.
A great book on the origins of the atmosphere and life on Earth is Dr Thomas Gold’s “Deep Hot Biosphere.” It also suggests the abiotic origins of oil. As far as I know, it’s the only complete theory on the Geological formation of the Earth. Excellent book.
You can learn a lot just reading the comments on Amazon:
Thanks for your very helpful response.
I think you may have misunderstood my comments about CO2.
Since atmospheric CO2 is just a trace gas, I had always assumed that most of the carbon in organic molecules came from the Earth, drawn up by plant roots in some manner, like nitrogen.
Re: “Originally, there was no atmosphere.”
That surprises me, since our sun mostly formed from gaseous hydrogen.