Scratching gives a brief burst of relief, but it also stimulates the same nerve fibers that carry itch signals and can trigger more itch sensations. Scratching also damages the skin and releases chemicals that activate immune cells, which can keep the itch signal going.
This creates a cycle: itch leads to scratching, scratching causes minor irritation and inflammation, and that irritation sends more itch signals to the brain. Repeated scratching can thicken the skin and make the nerves more sensitive over time.