Here's how it works:
* Ionic bonds form when one atom loses electrons (becoming positively charged, called a cation) and another atom gains those electrons (becoming negatively charged, called an anion).
* The opposite charges between the cation and anion create a strong electrostatic attraction, holding them together in a compound.
For example:
* Sodium (Na) loses one electron to become a positively charged sodium ion (Na+).
* Chlorine (Cl) gains that electron to become a negatively charged chloride ion (Cl-).
* The opposite charges between Na+ and Cl- attract, forming the ionic compound sodium chloride (NaCl) – table salt.
Important note: Not all compounds are held together by ionic bonds. Covalent bonds, where atoms share electrons, are also a common type of chemical bond. However, the principle of opposite charges still applies in a different way for covalent bonds, as electrons are shared between atoms with different electronegativities, resulting in a partial positive and negative charge on each atom.