Yuttadhammo Bhikkhu discusses thisanswers a question about "guarding the senses" in his last video (unfortunately it's 41 minutes long and I don't recall at what point he was discussing it)this video (at time 34:40).
Guarding the sense doors is a way of protecting ourselves from being overcome by passion for the sensed object (which leads to dukkha). In his video Yuttadhammo mentions three ways to do this.
Physically avoiding the object (in relation to your example, when on alms round monks may keep their eyes facing down to avoid lust from seeing a beautiful woman).
By developing samadhi the mind is disconnected from the sense doors (only the sixth sense "thought" is present)
By developing insight we know the inherent dukkha of sensed objects, therefore no passion arises for them when they are sensed.
The third approach is part of the goal, the first two are training practices to help us maintain a calm mind to achieve the goal.