if your employer is so unhappy with you that, even when you’ve shown your skill, he’s unwilling to pay you a competitive amount then it’s clear you don’t really have a future at your current job
This is the crux of the problem - people assume that anyone going to their boss asking for a raise is underpaid. That isn't always true.
When someone goes and finds a new role on more money it's almost always at a higher level. People move upwards when they move on. Matching an offer usually means paying someone the salary for the higher level role to do the work of the lower level role.
If someone wants to move up a level to earn more I've always been happy to talk to them about that. That's not what we're talking about here though.