How is the charge of covalently bonded atoms determined?
As you point out, formal charge is a "bookkeeping" method of assigning electric charges to atoms in a way that lets us easily approximate where the electron density is.

Chemistry is made up of layers of successively less detailed approximations. The concept of "formal charge" is near the top of the stack - very little detail is involved. It is only slightly more detailed than Lewis structures, in that we are at least trying to acknowledge that covalent bonds don't really share electrons equally.

With that in mind, we will look at the next higher and next lower level of detail, to see why formal charges are useful.

Whenever we draw a Lewis structure, we imply that each line is made up of two electrons that share a molecular orbital that exists somewhere in the space between the two atoms that it connects. Without knowing any better, we would assume that each electron can be wherever it "needs" to be to fill the valence shell of an atom. So, in the case of $\ce{CO3^2-}$, the carbon has four bonds and no lone pairs, giving it a full octet. The oxygen atoms have either three lone pairs and a single bond, or two lone pairs and a double bond, again giving each a full octet.



Note that we counted each electron twice for the purpose of checking the valence configuration. It's as if we are saying "each atom can borrow electrons from the other whenever it needs them." We are effectively ignoring any tendency of atoms to pull electrons towards each other - they float between atoms as needed, as if maintaining a full octet were the most important job in the world.

Next we look at the formal charges. The rules for determining formal charge say that we count the number of valence electrons an atom normally has (without bonds), then subtract the electrons we assign to it. We assign to an atom all of the electrons that are in lone pairs, plus one half of the bonding electrons. In other words, instead of saying that each atom gets the electrons whenever it wants them, we are saying "each atom in the bond divides the electrons equally between themselves." When you do this, you find that some atoms have "extra" electrons (more than they would normally have in the valence shell) and some have too few - thus, a formal charge.



This starts to give us a slightly more correct picture of how electrons are distributed inside of a molecule, but it doesn't really tell the whole story. Notice that we didn't care about what type of atom it was when we split up the electrons. We only looked at that to find the "natural" number of electrons it would have.

The next layer of detail involves electronegativity. In any covalent bond between two different elements, one element "likes" electrons more. The reasons for this are complex, and you have to go down another couple of layers to get to the reason. For now, just know that it is related to quantum mechanics.

If we know the relative electronegativities of elements, we can start to account for this tendency as well. We do this when assigning oxidation numbers. With oxidation numbers, you assign to each atom all of its loan pair electrons. Then, for each bond, you give all electrons in the bond to the more electronegative atom. Then we subtract the total from the number of valence electrons the atom normally has. 



Notice what we are doing. First we said "all electrons are shared equally all the time." Then we said "Divide the electrons equally." Finally we said "the most electronegative atom gets all of the electrons."

None of these is actually true, but each gives a quick approximation that is useful for a particular type of problem. To get a real picture of what is happening to the electron density, you have to do detailed quantum mechanical calculations. They are really hard to do! We typically use computers to solve them. But, if we know what the limitations are, we can use quick approximations to get an idea of where the electrons are at that is good enough to, for example, make reasonable predictions in organic chemistry.

To summarize:


Valence count - assume all electrons are shared equally
Formal charge - assign one half of bonding electrons to each atom
Oxidation number - assign all bonding electrons to the most electronegative atom