What are we Doing when we Connect to SQL Server?
Usually, you are making a TCP connection to a remote host. 

SSMS would ask your DNS server for the IP address associated with the hostname of the server, then initiate a TCP connection to that address on remote port 1433.

SSMS and MS SQL Server would then begin a conversation using the binary Tabular Data Stream protocol (TDS).

You type a query. SSMS encodes this query into TDS. SQL Server gets it, parses it, runs it, returns some data (encoded in TDS), back to SSMS, which decodes it and displays it on screen. 

However, you can also connect to SQL Server installed on the same OS as SSMS, or running in a virtual machine on the same box.