Here's why:
* Barium iodide is an ionic compound formed by the combination of a metal (barium, Ba) and a nonmetal (iodine, I).
* In ionic compounds, the metal loses electrons to form a positively charged ion (cation), while the nonmetal gains electrons to form a negatively charged ion (anion).
* Barium forms a +2 cation (Ba²⁺).
* Iodine forms a -1 anion (I⁻).
* To balance the charges, two iodide ions are needed for every barium ion, resulting in the formula BaI₂.