One side of the signal is transmitted via the base through the ground lug of the wall wart and broadcast from the ground wiring in the walls of your layout room/ building.
The S guage engines are "seeing "this signal and are waiting for the track signal to respond to Legacy commands.