We have to go way back for this one, before the formation of the earth. Back then we had a real dusty mess, probably caused by some giant star barfing. The Earth, the Sun and the planets started globbing this dirt. The four most common elements swirling around were (in order): hydrogen, helium, oxygen, and carbon. We had lots more heavier elements formed by past stellar explosions.
The Sun and Jupiter sucked up most of the hydrogen and helium, leaving Earth and the rest with the rockier stuff. Lots of carbon fluff bombarded the earth. Eventually the heavier stuff (iron, etc) sunk to the centre of the earth, leaving us with a lot of carbon, oxygen, and hydrogen (in the form of water).
Thus began the great carbon and water cycles. We started with a certain amount of the stuff, but only a variable percentage stays up where we can see it. Over geologic time, there have been great variations.
We now imagine that we are the janitors who take care of the earth (a la that weird movie!). We have two dials, one that controls total available water, and one that controls total available carbon.
(Whoops, old guy has to go to bed!)