Ionic compounds are electrically neutral, so there must be a balance of cations and anions in a compound. When combining, positive ions collect enough negative ions to offset their charge. In any compound, the number of atoms of a ion depends on the ion it is bonding with.