Live and neutral lines are fed through a sensing transformer. All the while the outgoing current matches the returning current, the transformer is balanced. However, if a leakage path to earth develops downstream of the elcb (they are called RCD's in the UK these days), the returning current will now be less than the outgoing current and and the sensing transformer will be unbalanced, which in turn will trip the device isolating the output from the input.
One common misconception with RCD's is that they need an earth connection to work. They don't
Regards,
Nigel