When I connect to another SQL server through Management Studio of my locally installed SQL Server, and execute query, I know that query executed there, on real server, but I see result in my Management Studio.
I don’t know how exactly Management Studio show result, whether get some kind of XML or something and then render it, or it simple act like remote tool, in fact, simulate Management Studio of remotely located server?
Management Studio will connect to the remote SQL server via TCP/IP, execute a query or a batch of queries, then return the result to you in the results window.
SQL Server uses a protocol called Tabular Data Stream (TDS) to send the data over the network, you can read more about it here: http://msdn.microsoft.com/en-us/library/ee320917(v=sql.105).aspx.
As long as the remote SQL server has TCP/IP enabled and there are no other restrictions in place (firewalls etc.) you can connect to an SQL server across the other side of the world (with the correct credentials of course).