Here's why:
* Sodium (Na) is a metal in Group 1 of the periodic table, meaning it forms a +1 cation (Na⁺).
* Iodine (I) is a nonmetal in Group 17, meaning it forms a -1 anion (I⁻).
To form a neutral compound, the charges must balance. Since the charges have equal magnitude but opposite signs, one sodium ion combines with one iodine ion to form NaI.