As iodine has a higher electronegativity value and 7 valence electrons, it takes the valence electron of potassium to complete 8 electrons in its valence shell thus forming the anion and, as consequence of losing one electron, the K atoms forms the cation
This reactivity order reflects both the strength of the C–X bond, and the stability of X(–) as a leaving group, and leads to the general conclusion that alkyl iodides are the most reactive members of this functional class.