Windows has APIs that allow you to view what's on the clipboard (and receive notifications when the contents change). It also has APIs that allow you to place items on the clipboard.
RDP interacts with the clipboard on both the server and client. When you copy something, RDP will synchronise the item across on the clipboards of both machines, allowing you to paste it on either (I'm not sure if it transfers data at the time of copying, or time of pasting; either is possible).
Also, you are "connected to the other machine's network". Not as directly as a local network, but you must have a network connection of some sort for RDP to work at all. The internet is just one giant network, after all.
See also (note that the APIs mentioned in those blog posts are the older ones; Vista introduced newer clipboard APIs but the basic principle is similar):
In the local session the TS client is in the clipboard viewer chain and in the remote session the RDPCLIP virtual channel application is in the viewer chain. When a clipboard update happens in the local session, the TS client is notified and informs RDPCLIP of the changes so it can propagate them to the remote session. Similarly, when a clipboard update happens in the remote session, RDPCLIP is notified and informs the TS client of the changes.