It depends on the way each system uses SSH.
If you connect to a server using SSH and go to a terminal session and start vi, then the editing happens completely on the remote server. You only see a copy of the screen at your local machine.
I don't know all the details of VSCode remote development feature, but I see it creates a process on the remote machine, which acts as server for the Visual Studio Code process running on your computer. I think the server part opens the files at the remote server, and sends the contents to the editor, and vice versa.
Neither of these approaches sends the physical file to the client computer.
Another approach is used by desktop SFTP clients. They might have an option: "Edit file". In this case, the SFTP client downloads the file content to local disk and then starts the chosen editor to edit file on local disk.
Once the editor is closed, the SFTP client uploads the file to remote server.
And one more approach is full desktop remote access, for example VNC over SSH tunnel. In this case the graphical desktop from remote computer is shown at local computer. When you edit files there, all file operations happen at the remote server.