Here's a drawing of a GFCI/RCD from Siemens, they have a lot of great tech info to look at and readily available.
The large coils, W1 and W2 detect any imbalances across a system in this case shown for a three phase system. For 120V/230V system, ignore the other two lines with terminal 3 & 4 and 5 & 6.
W1 W2 are current transformers, they pass the conductors around a central core much like a ferrite, but without the frequency drama of ferrites.
W1 looks for sine waves, W2 for us is important, it measure pulses, cause the waveform from amplifiers, SMPS, anything that has a transformer and diodes will draw current like this.
If there is an imbalance, a voltage is created across the secondary windings which is sensed and a mechanical device switches the output off. The test function injects a current into the path to simulate a real fault, so the whole device can be tested.
You can see two boxes A & E which contain electronics, yes to do all the sensing and to activate the trip mechanism. Now these electronics have to shut up their noise, otherwise, they will cause a trip by themselves, hardly the point of the device in the first place. I would imagine if these detection systems fail, the GFCI would trip all the time and never close properly. A good GFCI will only look at 50/60Hz and not everything else.
But this does lend itself to produce an "audio grade device", there are devices that have the electronics in a separate box, and generally these are not cheap, as they have selectable delay times, and sensitivity controls far more suited to larger distribution systems and not for direct people contact protection.
GFCI can nuisance trip when you apply power to a device that has an EMC filter on a TN supply (not on a balanced supply). This is due to the internal capacitor of the RFI filter charging asymmetrically across the power line and ground. This imbalance is seen by the GFCI and it trips. If you immediately reclose the GFCI, the capacitor is already charged and will draw no assymetrical current any more and the GFCI will hold closed.