I think you're asking about the 'ground-fault interrupters' which are usually included on electrical outlets in bathrooms or other places where there's a major danger of shock. here's the idea of how they operate, if I understand correctly.
Current is supposed to flow from the 'hot' lead out through a circuit back through the 'neutral' lead. If somebody is accidentaly being electrocuted, the reason is usually that the current is flowing through them back to the 'ground' or neutral part of the circuit via a bathtub or a sink or a radiator etc, not through the neutral lead. That means that in the outlet the current through the hot lead and the neutral lead aren't equal.
The GFI is designed to sense that condition and shut off if it occurs. I believe that the technique is simple. A little switch with magnetic material on it is pulled on by magnetic fields made by the currents going through coils. The current through the hot and neutral leads go through different coils and pull opposite directions. So long as they're about equal, the switch doesn't get pulled. If they become unequal, the switch is pulled.
This system protects against the most common problems, but it wouldn't help if you somehow touched the hot lead with one hand and the neutral with the other. The current through the leads would stay equal even though you were part of the circuit.
(published on 10/22/2007)