Dogs don't get enough credit for how intelligent they really are. They learn their owner's patterns and can equate what they see to an activity. Mine do the same thing.
I can say "I'm going to the basement" and they head right to the door and go downstairs and wait till I get there. They also know when I tell them I'm going outside and they head to the back door. Very smart.