It turns out scratching feels so good because it causes a low-level pain signal to shoot up to the brain and override the itch signal to provide us with relief. That's why pinching or slapping the itchy spot can work, too.
Why does gentle scratching feel good?
Nerve cells tell your brain something hurts, and that distracts it from the itch. It can make you feel better in that moment, but 1 in 5 people say scratching makes them itch somewhere else on their body. Sometimes the pain from scratching makes your body release the pain-fighting chemical serotonin.
Why does itching a bite feel good?
Here's how it works: when something bothers the skin, like a mosquito bite, cells release a chemical, usually histamine. That release provokes the nociceptors in the skin to send a message to the spine, which then relays the message through a bundle of nerves called the spinothalamic tract up to the brain.