The basics of how a RCD works is like this, current flows through both the line and neutral winding forming electro-magnets.
Because the two coils are wound in opposite directions they make opposite magnetic fields. As the same current is flowing in each coil they both create the same amount of magnetism, so they cancel each other out, thus there is, in effect, no magnet.
When a fault occurs most of the electricity flows back to where it came from via the earth wire instead of the neutral. This causes an imbalance in the magnetic fields.
Now the Line coil is stronger than the neutral, so it is not cancelled and can thus pull the contact apart; breaking the circuit and protecting you from the fault that would otherwise attempt to kill you.
So basically the earth is an escape route for any fault and any current running down it will cause an imbalance and disconnect from the supply.
The amount of current required to "trip" a RCD is down to the sensitivity of the RCD.
A 5mA rcd will trip with lower current faults than a 30mA rcd.