When a chemical compound is formed then ions of one reactant react with the ions of other reactants, exchange of electrons take place and pairs of ions get held together due to electrostatic forces but how do one pair get bound to another pair
In an ionic reaction involving formation of ionic compound by transfer of electron from one atom to another. In such a reaction, the atom loosing an electron becomes positively charged and the atom gaining an electron becomes negatively charged, thus ions of opposite charges are created, and as a law of nature opposites attract each other, so the positively charged ion is attracted by the negatively charged ion by a strong electrostatic force of attraction. This force keeps the ions together in an ionic compound.