Sorry, I misunderstood your question, I took it as pertaining to reaction equations, while you meant mass and charge balances for solution (or whatever).
But it is still not very complicated.
When you add any substance to solution, it may dissociate, react with other substances and so on. Mass balance tells the simple thing - amount of substance that was put into solution stays there, it may be just there in a different form. So, if you have added phosphoric acid to solution, it dissociates, but total number of moles of all dissociated forms doesn't change and equals amount of phosphoric acid introduced into solution.
Charge balance - all solutions are always neutral. That means amount of positive charge (in form of cations) equals amount of negative charge (in form of anions). However, you have to account of the fact that non all cations (anions) are charged equally - some have smaller charge (like +1 for Na
+) some have higher charge (like +3 for Al
3+). Those that carry more charge should be in a way counted more than once. Thus for example for MgCl
2 solution charge balance equation takes form 2[Mg
2+] = [Cl
-] (Mg
2+ counts as two).
And the A was [Cs+] + 2[Ca2+] + [H+] = [OH−] + [F−] + 2[CO32−] + [HCO3−]
I'm not sure how to know which elements to throw in... and aren't the charges 6 on the first side and -7 on the second?
Not elements - IONS. All ions that are present in the solution.
And no, there is no 6 & 7, but 5 on both sides.