A train is detected because it shorts the circuit. In railroading, this is called “shunting” the circuit. When a train enters a block, the metal wheels and axle conduct the circuit as a short cut which bypasses the relay. This de-energizes the relay, which causes signals to report the block as occupied.