The first kind of damage is disk file corruption:
All modern operating system use a
write buffer which means when you save a file such as word document, it doesn't get saved to the actual disk straight away, it actually gets stored until your operating system (Windows) decides to write it to disk which could be instantly or it could be 1 or 2 minutes later.
Even then, after Windows has written it to disk your disk may also have
a write buffer, storing it in it's own memory while it tells Windows it's been stored.
This is all done to improve performance and is generally something you want left on though if your computer is important like a server,
you can turn it off.
If the computer loses power during one of these writes, the data being stored by Windows in the buffer is generally lost. If the data being written was something critical it could corrupt your partition, potentially losing all of your data in one go (note NTFS keeps duplicates of it's partition and MFT just for this occasion!). With hard drives, if they use a write buffer, some kinds (such as high end or server RAID devices) come with a small on-board battery backup to prevent loss of data if they lose power.
Another kind of damage that can be caused, is actually physical. Your computer is designed to run on a constant voltage, and your PSU converts that voltage into something your computer can use. If that voltage coming in drops too low, or rises too high, it can damage the PSU. This damage can also be transferred to your motherboard, video card, hard drive and any other device causing damage to them. This could be something simple like tripping a fuse or more serious like burning out a chip. Some people even claim that a UPS can help fix issues like BSOD or crashes that my be caused by unstable utility power supply.
A surge protector can protect against large surges of voltage, but it cannot protect against bad utility power supply or other kinds of power issues such as under voltage, over voltage or frequency instability.
This is why it is recommended for everyone who has a computer to have a Battery backup, also known as an
Uninterruptible Power Supply.
l wont go into a
discussion here, (there is plenty of information about
them on the internet) but generally they operate by detecting a loss of power and then providing power from a built in battery for a short time (depending on battery size). (They can even be used to charge your mobile phone in a pinch!) and you really should have one or two protecting your most sensitive and valuable electronic equipment.
Don't forget to also put your monitor (so you can see), and modem, router or whatever other device you use to connect to the internet on the UPS as well, or you'll lose connection when the power goes out.