Most surge protectors use MOVs - Metal oxide Varistors, their resistance decreases as the voltage across them increases, and decreases sharply above a specified operating voltage, following a sort of bathtub curve. You'll typically find at least one MOV on the circuit board in most switch mode power supplies, including those used in appliances., they're usually a blue disc, and look a little like a ceramic disc capacitor.
A surge protector will typically use 3 MOVs, to connect between live, neutral and earth, so they dump the excess power from a surge, pulling down the voltage and therefore generating heat. The MOVs are degraded by surges, so don't last forever. Surge protectors may also have a fuse to kill the power before the mov gets overloaded, which might otherwise cause it to catch fire.
There's a much better explanation in Wikipedia
https://en.wikipedia.org/wiki/Varistor
There's a teardown, plus circuit diagram of a surge protection device here, with a LED to show if it is working or not.
Here's a more typical plug in one
I think the mains filters you find in appliances like washing machines primary purpose is to suppress common mode interference and mains spikes produced by the machine traveling up thee power line, so it doesn't cause electrical noise, and I think it may improve/ correct the power factor too. My mum had a nice 1980 microprocessor controlled Hotpoint (UK) washing machine, which had a large mains filter that violently exploded after about ten years, while I was using it. Didn't hurt the machine, which continued to work fine without one for years, once I'd cleaned up the mess and bridged past it, although the blast from it did hurt my face and hearing.