Why does pain hurt?
There are people who don’t feel pain, it’s generally referred to as Congenital Insensitivity to Pain (CIP).
A lot have them have very short lifespans, because pain plays a huge role in learning what we shouldn’t do for the sake of preserving ourselves.
People who don’t experience that harm themselves a lot, accidentally or otherwise. Some kids especially will intentionally injure themselves in small ways because to them it’s no different than biting their nails. A lot of people end up in the “extreme sports” category of having fun and get themselves killed because they just have a horrible gague on what’s actually dangerous for them.
So pain evolved to prevent us from being self-destructive.
As for why we literally feel pain, That’s sort of tied into why experience anything at all. Why are we conscious rather than just an unconscious machine made of flesh and nerve endings? At what point does an unconscious machine become conscious? Can we even explain consciousness as a function of something else, or is it a fundamental property of the universe? IDK, and neither does anyone else.
pain evolved as a way for our bodies to tell us that something is wrong and that we need to look after it.
It’s a sensation, that through evolution, classical conditioning and watching others in pain, we know its bad and that we need to do something about it. if I got stabbed in the leg and didn’t feel pain i would be at a lot lower chance of wanting to fix it.
edit: or if I had a broken rib for example, If i didn’t have pain and didn’t know ha tit was broken, i would maybe continue doing whatever i was doing that broke it in the first place and continue breaking ribs.
Because it makes you not want to do whatever hurts.
If there was a version of an animal that didn’t feel pain, evolutionarily speaking, it wouldn’t make it very far, as it’s far more likely to get seriously injured or die before reproducing.