When writing code you might have written 10 lines of code in the past week, but the next day you write 200 because you've been thinking about the structure of the solution. In this way you might be working even if you're going on a walk or doing the dishes.
This isn't unique to programming, of course.