Here's why:
* Sodium (Na) is in group 1 of the periodic table and has a +1 charge.
* Boron (B) is in group 13 of the periodic table and has a -3 charge.
To balance the charges, you need three sodium atoms (+3) for every one boron atom (-3). This results in the simplest whole-number ratio, which is NaB.