Here's why:
* Na represents the element sodium, which has a +1 charge as a cation (Na+).
* I represents the element iodine, which has a -1 charge as an anion (I-).
Since the charges balance out (1+ + 1- = 0), the formula NaI represents the stable ionic compound formed between these two elements.