Sometimes coding is just mindless typing some boiler plate. It's easy to pay attention to something else. I see it like listening to podcast or something while mindlessly grinding in a game.
The analogy I like is how people listen to the radio while driving. Sometimes you’re just doing something pretty simple (like a tedious refactor) and can move forward while watching something else