I suppose /etc/ttys defines "listening sockets" on certain devices (serial lines originally) that spawn the processes listed for a given device when there's a new connection.
Now when you exit from a console login, the listeners for the console device get spawned, which are the loginwindow...