Actually there is not a connection between the two datases (or the machines running the databases), but between the SJA (SQLyog Job Agent) executable and each of the servers (in case Data Sync is running from another machine than the machines whre the MySQL servers are).
Also Data Sync is not (a) command(s) executed by the server. A MySQL server cannot control another server (with the exception of what the rare Federated Storage Engine does). Managing data on a server requires a client.
It is the client (SJA) that controls what is happening on the server and is doing so by sending rather simple INSERT, UPDATE and DELETE statement. What is not *rather simple* however is to decide *what* statements to send. SJA will retrieve information about data stored on both servers to find out this. When the need for a statement is found it is sent to the server at once and the server will execute it. It will progress through each table like that. So if connection to either server gets lost SJA cannot continue and will abort. And sync is not complete. But it can be started again as soon as connection is again available and will be faster this time (unless lots of data have changed in between)