How Terminal Services Works
Terminal Services allows users to connect to a Terminal Server(s) and access applications or an entire desktop. To establish their client/server session, users utilize the Remote Desktop Connection (RDC) client. The RDC client, in turn, uses a multichannel protocol called the Remote Desktop Protocol (RDP), which is an extension of the ITU T.120 family of protocols. By default, RDP-based connections are made over TCP 3389, or if Terminal Services Gateway is used, then the connections are made over TCP 443 (HTTPS).
When a user uses RDP, client mouse and keyboard events are redirected from the client to the server. ...
How terminal server works