Mechanism of 5‐(iodomethyl)oxolan‐2‐one synthesis from 4‐pentenoic acid and iodine in acetonitrile
https://en.wikipedia.org/wiki/Iodolactonization
I+ reacts with the CC-π electron donor. A cyclic iodonium three-membered ring intermediate is formed. The carboxylate group opens the electrophilic intermediate to form the product lactone. 5-membered rings (gamma-lactones) https://en.wikipedia.org/wiki/Lactone are prefered due to optimum entropic and enthalpic parameters of activation.