Here's why:
* Hydrogen (H) is in Group 1 of the periodic table and forms a +1 ion (H⁺).
* Iodine (I) is in Group 17 (halogens) and forms a -1 ion (I⁻).
Since they have equal but opposite charges, they combine in a 1:1 ratio to form a neutral compound, HI.