Some notes to be aware of:
Write protecting the SD card may cause the entire system to simply not start up. Some files are temporary/dynamic, and need to be written to while the OS (or programs in the OS) is running. There are solutions, of course, such as creating a fake disk drive in RAM to hold these temporary files (being temporary files, there is no problem if the power failure caused the RAM to disappear). Modern Linux kernels do this or similar already; The /run and /sys directories are created in RAM, and not actually written to any physical drive. Others, such as some of the files/directories in /dev, are created as needed.
As for how and why corruption happens.. Understand that reading/writing to he SD card is very slow compared to the speed of the CPU and RAM. When the CPU is executing billions of instructions per second, and the RAM is accessing memory locations in a similar manner, all is well. But what happens when you need to read or write from/to the SD card? It can only read/write at maybe a few thousand memory locations per second.
You do not want the OS to just stop everything to wai for the read/write to complete.. Imagine if you loaded a web page that took a full minute to load. But while it was loading, you had to wait until it was done! You could not drink your coffee, you could not switch to another web page, you could no even tell it to stop loading because you are impatient.
So what the OS does is cache certain data in the RAM so it does not have to constantly wait to read it again from SD. It does it when it writes to SD, as well: Instead of actually writing to the SD card, it saves the data to RAM and schedules it to be actually written to SD at a later time, when the CPU/OS is not so busy, and goes back to doing other things, such as responding to your wishes.
The corruption happens when this data is only in RAM, but the power fails. No power to keep the RAM fresh, so it cannot write the cached data to the SD card. It's gone. So the data on the SD card is now outdated--I does not have the data that was in RAM. Sometimes you are lucky and it does not matter; the lost data is trivial and can be created again. Other times, the lost data is critical data, and corruption results.
Even a small change can cause a big problem. If a file got only one byte larger, the OS has to update the disk data: Both the one byte added to the file, as well as the data on the disk that tells the OS how big the file is. I has to update that to know the file is now 1 byte larger. Again, however, that information is cached in RAM and scheduled to be written to the SD card later.
If a power failure happens now before it writes the new size, the SD card will "think" the file is still the old size. That new bye is completely lost--corruption.
Most operating systems take steps to try to minimize the risk, but it cannot be completely eliminated. Even making the SD card write protected is not perfect; The SD card degrades over time until it can no longer maintain the data stored on it.
An EMP (Electromagnetic pulse) is similar--it causes electrical devices to short and burn out. So your SD card may still be wiped out if it suffered a strong enough EMP. And so on.