Formed when CO2, (dissolving in at the surface and breathed out by the fish), and H2O, (correct me if I'm wrong, we have that in the tank as well), are in contact
Not so simply
When pH is under 8, only 1/400 of CO2 dissolve in water to form H2CO3. So it's quite small amount. And H2CO3 is a weak acid (Ka = 4,3*10^-7 mol/l) (When pH is over 10, reaction is dominant.)
CaCO3 to dissolve in sufficient quantities
Every tests, which I have made, have shown, that CaCO3 doesn't affect pH or GH so much as people usually want (fish-stores tell client to add some crushed shell, coral etc. to increase GH for platies, mollies...) You need alot of fishes to produce CO2 and lot of CO2 should form H2CO3, but...
(If you need to increase KH or GH, use baking soda and model gypsum).
When I have more time, I want to do some test: I put water in two pails. to both pail I add crushed shells/coral. Fill them with water and one of those pails I add CO2. I measure pH,KH and GH several times during 2 weeks. Now Im quite busy with my laboratory-works...