Track circuit I assume. Each section of track is electrically insulated from the next. The metal wheels and axle of the train complete a circuit across the rails and that's how the signallers know exactly where each train is.
If the circuit fails for whatever reason, they don't know where trains are and can't signal accordingly.
But yes, that's not an immediately obvious explanation to the train passenger who has never whiled away a few hours reading up on the technicalities of railway signaling.