The GFCI device uses a differential transformer to compare the current "going out" on the hot leg with the current "coming back in" on the neutral. If there is a large enough difference between the two, typically 5 milliamps (30 in some places), then that is considered an imbalance, and an internal solenoid mechanically trips the built-in circuit breaker cutting off connection to both the Live and Neutral pins. 