GFCI products prevent electrical shocks by monitoring the flow of electricity in a circuit. In particular, they monitor the amount of electricity going into the circuit and the amount of electricity returning to the circuit.
GFCI devices are especially sensitive to leaks. A leak occurs when the amount of electricity returning to the device is less than the amount of electricity entering the circuit.
When a GFCI device detects a leak or other abnormalities in the electric currents, it instantly disconnects the circuit and cuts off all electrical flow. By doing so, electrical shocks are prevented from happening.