The software on the controlling computer transmits its own keyboard and mouse activity to the controlled computer, where the remote control software implements these actions.
The software on the controlling computer watches keyboard and mouse activity. The actions are sent to the controlled computer, where the remote control software simulates these actions.