I guess this makes sense but it is a little annoying. My character got ambushed by a bunch of Thugs and so he ran away (toward Bordertown) and the townsfolk there joined in to fight the thugs. Which was great even though no experience was given unless my char landed the death blow. What I didn't realise was that the Thugs could kill the NPCs. Quite sad that now the herbalist (?) bloke is no longer there to sell stuff from his inventory.
Are quest NPCs set as unkillable because it might break a quest if they died?
Well side-quest NPCs certainly aren't because I've seen a couple go down to beasties (the lady who's lost her husband for one), and I've killed a couple myself (albeit after the main quest has progressed past them).
The lady who's lost her husband, give me a quest, then i camp next to her.
Some lizards appeared and hit her only one time to kill her. So i lost the quest! This is bad...
Why is it bad? That's life. In the real world she might get eaten by lizards while you are not even around, and then you'd never know (see: Oblivion, Gothic 3).