Stereoselectivity of ring closure in intramolecular iodolactonisation
The results of the iodolactonization example presented in this question were published in 1982 by Bartlett, et al.1 While @Aniruddha Deb has captured the essence of the reaction, there is more than one product formed in the reaction. A more detailed mechanism is offered, an issue not addressed by the original authors.
Carbonate 1 is a racemate. No products derived from reaction at the remote 7,8-double bond were detected. Understandably, the rate of closure is faster for a 6-membered ring than a 7-membered ring. A transition state for ring closure for a reversibly formed iodonium species will be favored having the carbon chain R equatorially disposed in the transition state. Transition state 2 is favored over that of 5 because the latter encounters a gauche butane interaction. In the iodonium cation the C-C bond is shorter than the C-I bond thereby having the former of greater steric consequence than the latter. SN2 attack on the iodonium cation is favored by the more polarized carbonyl oxygen than the oxygen attached to the t-butyl group. In the latter instance, establishing a positive charge on this oxygen is counterproductive because it is adjacent to a partially positive carbonyl carbon. This objection is in keeping with why amides are preferentially protonated on oxygen and not nitrogen. The cations 3 and 6 are now poised to lose a t-butyl cation, which, given the solvent acetonitrile, may lead to Ritter intermediates besides t-butyl iodide. In the event, racemic cyclic carbonates  4 and 7 are produced in 69% yield with the cis-substituted isomer 4 predominating over the trans-isomer 7.


P.A. Bartlett,  J. D. Meadows, E. G. Brown, A. Morimoto and K. K. Jernstedt, J. Org. Chem., 1982, 47, 4013. https://doi.org/10.1021/jo00142a002