They don’t. Not all electronics. They can also damage storage devices that are based on magnetic storage.
A credit card strip, hard drive, magnetic tape, floppy disk, and so on. All of them rely on magnetic ferrite coatings that are magnetized in certain patterns to store data. A magnet strong enough for these magnetic patterns to be disturbed will cause the data to be lost.
I have never seen non-magnetic electronics be destroyed by a magnet.
You could make a switch-mode power supply malfunction by placing a strong magnet on the core of the ferrite. This would cause it to saturate, and then malfunction. The inductance would decrease by 10 to 1000 and transformer action would be severely impeded.