Here's a breakdown:
* Cations are positively charged ions formed when an atom loses electrons.
* Anions are negatively charged ions formed when an atom gains electrons.
Opposite charges attract. The positive charge of a cation is attracted to the negative charge of an anion, creating an ionic bond. This electrostatic attraction is what holds the ions together in an ionic compound.
Example:
In table salt (NaCl), the sodium ion (Na+) has a positive charge and the chloride ion (Cl-) has a negative charge. The electrostatic attraction between these oppositely charged ions forms the ionic bond that holds the compound together.