Put simply, replay devices are interfaces between a PC and a console— similar to how you might use a GPU to interface with a monitor or a NIC to interface with a LAN— and by playing back a movie over one of these console interfaces, it can be console-verified. (Specifically, if it finishes without desyncing then it's considered verified.) The replay device simulates a gamepad (or several) for the console to "see", and typically appears as a serial device on the PC. Newer designs have included an SD card to allow running without a PC.
You can read about the specifics of simulating a gamepad over on TASVideos.