Here's why:
* Ionic compounds form when atoms gain or lose electrons to achieve a stable electron configuration.
* Cations are positively charged ions formed when an atom loses electrons.
* Anions are negatively charged ions formed when an atom gains electrons.
The overall compound remains neutral because the positive charges of the cations balance out the negative charges of the anions. However, the individual atoms within the compound are no longer neutral.