By that, for coding, one good example is trying to work out how something new would be implemented, then how it would fit with existing things, then getting down to implementing. For that, you need a clear mental model of all the moving parts -- what's there, what's not there, what has to be added, and what has to change. When you're in the zone, you know where you are, where you're going, what to add and how to add it. Things just flow. Code appears, and you keep track in your head of files you need to visit and what you need to do in each. If left uninterrupted, you will eventually get there, and hours can disappear without you noticing. Same with debugging, when you're trying to map in your head what is going on, what should be going on, and what might be causing a deviation between the two.
You have to rebuild that model when you get interrupted, and the extent of the rebuilding is usually proportional (and monotonically increasing) to the length of the interruption and the extent you have to commit thought to it.
For legal work, I find that kind of work usually occurs in writing submissions or preparing cross-examination. You're thinking about your overall journey to win the case (usually all or part of your case theory) and how you help get there with what you're working on. You're keeping points made in dozens of cases that you have to interleave when you get to the right place, or that you have to take account of in the evidence (eg what kind of evidence does case X require me to adduce to prove point Y). You're thinking about what is persuasive (the key to all good legal writing) but also about what is accurate (duty to the court), what is admissible into evidence, and what is understandable to your audience (usually a judge). Again, when you're in the zone, it just flows and time has little meaning.
The overall interrelationship is the same as coding -- lots of moving parts in your head, lots of reliance on short-term memory -- and it suffers the same way from interruptions.
My pet theory is that the more that mental work requires saturating short term memory, and making use of it when saturated, the more vulnerable it is to interruptions.