The compound CaC03 is the reaction between the element calcium which has a naturally occurring 2+ charge on the atom and the compound carbonate. Carbonate has a carbon atom with four electrons in it's second shell and three oxygens each with six electrons in it's second shell.
With only four electrons in carbon's second shell there is room for four more. With six electrons in oxygen's second shell it has room for two more. The second shell of any element can take a maximum of eight electrons. The carbon atom always seeks to fill up it's second shell of electrons, that is why it is a strong organic atom. In this case it accepts an orbiting electron from oxygen and in turn oxygen gets one orbiting electron from carbon. In the case of carbonate there are three oxygens sharing electrons with carbon and there is one electron provided by carbon that is shared with the three oxygens in oscillation.
Each oxygen started with two missing electrons in it's second shell. Carbon accepted three oxygens into it's second shell providing a total of seven electrons in carbon. That leaves one electron on carbon and one each on oxygens without permanent bonds. Since carbon oscillates it's one electron space with each of the three oxygens that leave two of the oxygens with open space on it's second shell at all times. Electrons are negative, hence, the negative 2 charge on the carbonate ion.
The carbonate ion then bonds easily with it's two open spaces on the oxygens with calcium with 2 electrons in it's outer shell, 4s.