Halogen atoms like chlorine and iodine usually react by gaining an electron to fill their outer energy level in order to resemble the noble gases which are more stable. Chlorine is a smaller atom than iodine so its outer electrons are closer to the nucleus. Therefore, the protons in chlorine's nucleus attract the outer electrons more strongly and it is easier for the chlorine atom to gain an electron.