then
Modifier.then(...) accepting a @Composable builder block instead of a plain Modifier value — lets a modifier chain step read @Composable ambient state (a CompositionLocal, remember, a theme value) inline, without breaking the chain into a separate val first. Used throughout Modifier.styledWith/Modifier.size for exactly that reason — most of their individual steps depend on LocalDensity/CompositionLocals only available inside a @Composable context.
Parameters
block
builds the next Modifier step, with this receiver starting from a fresh Modifier (not the modifier chain so far) — chain continuation is handled by the outer .then(...) call, not by block itself.