Sodium ions bond with chlorine ions to form table salt, NaCl. Why does one sodium ion bond with one chlorine ion?
Why? Because of electrostatic attraction between unlike charges.
And of course, in an ionic solid (say
An individual sodium ion is electrostatically repelled by every other positively charged ion in the lattice also, but if you sum the repulsive and attractive forces up across the entire lattice, which can certainly be done quantitatively, a net attractive force can be shown to operate.