Selecting and moving a subpart of a mesh
The door is here a subpart of the window mesh object.

This subpart is defined as a part of the mesh (some vertices and faces between all the others). And this subpart is not linked to the rest of the window vertices. This is like you have here a subset of the vertices dedicated to the door.

As this subpart is so some kind of "vertices isle", he can select it by just selecting (with the mouse) one or two vertices and then use Ctrl+L because this shortcut means "select linked" or "starting from a selection, select also all the vertices linked by one or several edges to this primary selection".

Concerning the "move away" : this is the consequence of above. Inside the window object, door vertices are not linked to the other vertices. So they can be moved independently in edit mode.