I have access to a remote file-storage server at my work (through a VPN if that matters). I connected to the server, and ran a shell script on my mac at home to copy large files from one location on the server to another location on the server. It was going extremely slow so I tried using Microsoft remote desktop to login to a Windows machine that is on site at my work (and therefore on the same local network) and used a batch file to do the copying. This seemed to go much faster.
This got me curious about what exactly is going on with each of these processes. I suspect that in the first case, the files are being transferred over the internet from the server to my local computer and then back to the file server. Whereas in the latter case, the files are merely being transferred within the company's local network hence resulting in faster copying speeds. Is this assumption correct? Any information to satisfy my curiosity about how either of these processes work is appreciated!