I think it's something to do with: iterm2 interprets <magic control sequence> as triggering the tmux integration feature. But you can put that magic control sequence into other places.
Sure, but that explains nothing about how the tmux integration ends up running a local command. How is this doing anything more than confusing the terminal about buffers?