Illusory superiority[1] is a real issue - about 70% of people think they are above average, so they keep demanding above-market salaries.
Plus, as I mentioned in my previous post, other employers have harder time evaluating person's skills through interviews than a company that currently employs them. So they offer above-average salary to your average employees and by the time they realize that they overpaid for their skills it usually is too late, so they keep them on payroll anyway - that's basically how IT salary bubble works, most of the time :) (at least that's how it works in Poland, I don't know a thing about US job market)
From my experience the reason why employees who have another offer even bother to mention it to their current boss, asking for counter, is because that other offer has some serious downside that prevents them from just accepting it right away.
Anyway, I can probably replace you with someone that will gladly take your current salary. And if I can't and end up paying your replacement the money you demanded (or more) at least I'll be paying that to the guy who is happy to work for me, not to someone who is already actively looking for other jobs.
Management knows the market rate for a given role. Let's say a good-not-great senior developer (as in give them a code base and a quiet room and you've got substantive code on day 1 or 2) commands $100k cash comp to make the math easy. You take the job for 10% below market for whatever those reasons happen to be. Maybe your last job was only $95k but this one has a much better vacation/retirement package.
If you go to your boss after 6-12 months of being a good senior dev and a good employee (meaning all the admin nonsense that comes along with being an employee - meetings, timely communication, generally not being an asshole, etc) and say that market rate is $100k, you're getting paid $90k, and you'd like $100-105k, they know that's a fair ask. Whether they are willing and/or able to actually pay you that ask is another thing.
My point being that there's nothing "terroristic" about asking for what you're worth. You can do it without a competing offer, but often times a competing offer is the easiest way to get something close to a market rate number.