Earlier quoted context omitted.
It's a myth spread out by recruiters. They do not get paid when the developer doesn't change job. They'll say anything to get you to leave. Truth is, counter offers happen and work out. When it's about compensation, not toxic workplace/coworker, or relocating elsewhere to live with your wife/children.
A former manager - and friend - of mine told me that, when switching jobs, former employer made a handsome counter-offer, I think basically doubling his compensation; it was more than he got at the new gig. His reaction? "Now I also feel insulted. So that's how much I was worth to you, but you waited for me to leave before adjusting my pay?" It strikes me as a reasonable attitude, and one that I've adopted too. I don…
As a talented professional, you are constantly in the market.
What sets the market price? Market.
Your compensation is not about how much revenue you make to your employer, but what is the market price for the resource (you) and is the employer ready to pay the market price.
When you get an offer that is way above your current rate, your explicit market price suddenly increases. Before you get the concrete offer your market price is likely lower.
Big companies have salary policies that are not necessarily about what your boss would like to pay you. When you get an offer to leave your boss gets more leverage as well to offer you more comp.
"I know what our salary policy is, but this individual contributor would be really hard to replace and his cost just doubled. It's really expensive to replace him. Can I make a counteroffer that makes him/her stay?"