Here's why:
* Cesium is a metal in Group 1 (alkali metals) and has a low electronegativity. It tends to lose one electron to achieve a stable octet configuration.
* Iodine is a nonmetal in Group 17 (halogens) and has a high electronegativity. It tends to gain one electron to achieve a stable octet configuration.
When cesium and iodine react, cesium loses its electron to form a positively charged ion (Cs+), and iodine gains that electron to form a negatively charged ion (I-). These oppositely charged ions attract each other strongly, forming an ionic bond and creating the compound Cesium Iodide (CsI).