Z
Variable Constant
Why does pain hurt?
??? Are you five?
Why is light bright? Why is red red? Why does a stench stink? Because that's how it's defined.
Why is there an unpleasant sensation(qualia, if you will), when I stub my toe?
So that you will react in such a way to reduce or remove the damage. Duh.
Think about it: two organisms develop. One has nerves that cause an 'unpleasant sensation' (as you call it) when it's exposed to extreme heat; the other does not. Extreme heat occurs. One moves away from the heat, in order to reduce the sensation; the other doesn't, and dies. Which one reproduces?
So we have sensations which we innately avoid, because such an automatic reaction allows our species to survive and reproduce.
More intruigingly to me is that not all pain 'hurts' the same way - that is, some people can react to pain in entirely different ways than other people. Some people even like pain - they find it pleasurable. Some can even ignore certain levels of pain entirely. They are aware of it, but in its purest terms - that damage has occured and should be tended to. I fall into this latter category with most low-level pains. It's neither unpleasant nor pleasant; it simply is, like light or heat or sweet or C flat.