I can't stay away from this thread. The link posted very early (how GFCI works) has all the goods in it.
I'd like to try and summarize the clever science involved in a way that is not terribly difficult to follow, because when I read about it to gain my own understanding I found it very elegant and simple. Pure genius, really.
The key to the whole thing is a small coiling piece of metal, formed into a ring like a donut. If you take a device like this and run a wire through the center of the donut, you have the beginnings of a GFCI device. When current travels along that line through the hole, electro-magnetic forces are created around the wire. These forces cause current to start to flow through that coil, even though the donut and the current carrying wire are not actually physically in contact with each other.
When current is flowing one way (say left-to-right) in the wire, the current in the coil flows one way (say counterclockwise around the donut). When current on the wire in the hole moves the other way (right-to-left) the donut carries current in the clockwise direction.
When there is no net current moving on the line int he center of the donut, the donut coil itself carries no current.
So.... to make a GFCI detector....
All lines that are permitted to carry current in the circuit (be they hot lines or neutral lines) are passed through the doughnut hole together. The coil will monitor ALL of them simultaneously. If there is a net current flowing left-to-right, the coil carries counter-clockwise current. If there is a net flow of current from right-to-left, the coil carries clockwise current. If there is no net flow of current, the coil carries no current.
All that needs to be done then is to have circuitry that monitors the current IN THE DONUT COIL itself. If there is ever current moving around the donut in either the clockwise or counterclockwise direction at all, then that means that net current of the total group of lines passing through the center of the donut is not balanced and some current has found an alternate way of getting out of the system.
It does not matter if you are monitoring 1 hot and 1 neutral, 2 hots alone, 2 hots and a neutral, or even 101 hots and 37 neutrals.... it is totally irrelevant. All that matters is that all of these lines are passing through the hole of the magic donut coil and that the amount of current that is flowing left-to-right in some of the wires in the group is also flowing right-to-left in other wires in that group.