How residual current devices, or RCDs operate.
RCDs are devices which compare the current flowing in the line and neutral wires to an installation, circuit or individual device.
In normal operation the current in both conductors will be identical. If a fault occurs between either conductor and earth, the current in each conductor will not match, the RCD will detect this and disconnect the supply.
Older types used one or more large coils of wire to activate a solenoid, newer types typically contain much smaller coils and an electronic amplifier.