* Sodium (Na) is a metal in group 1 of the periodic table, meaning it has a +1 charge when it forms an ion (Na⁺).
* Iodine (I) is a nonmetal in group 17 of the periodic table, meaning it has a -1 charge when it forms an ion (I⁻).
To form a neutral compound, the charges must balance. Since sodium has a +1 charge and iodine has a -1 charge, they combine in a 1:1 ratio, resulting in NaI.