I think part of my job as a manager is to make sure that everybody is paid fairly all the time. For me that means benchmarking the salary structure to peer companies, a good career ladder, regular performance reviews, etc.
If one of my employees came to me and said, "A friend at company X said I could make $Y if I moved there", I'd definitely use that data to make sure our total package was fair. Hopefully we'd find we were already doing things well, but if not, I could easily see that research resulting in raises.
On the other hand, if somebody comes to me and says, "I already have an offer in hand from place X for $Y because I've been secretly job hunting for the last month," then I'd be very unlikely to counteroffer with more money. I'd certainly want to talk about why they were unhappy enough to start job hunting. Maybe there's a problem we weren't aware of or taking seriously enough. (And also I'd want to investigate how we hadn't discovered the problem until it was big enough they wanted to quit.) If we can solve that problem for them (and hopefully for other people, we should.
But if it's only a question of money when I think our pay is fair, then I wouldn't counter. One, I don't think money keeps anybody anywhere for long, so I'd expect the counter to be a bandaid. Two, either I have to change the whole salary structure to match or I've just made things less fair. That penalizes people who aren't as money-focused. Three, there are often reasons other places pay more on a cash basis. If somebody values cash more than other things I like to provide (e.g., working with good people, good work-life balance, more time available for learning, not having to clean up giant messes), then maybe they will be happier elsewhere.
And really, I'm fine with that. If somebody working for me would really be happier elsewhere, I'd rather help them find that next job. And if they won't be happier elsewhere but need to find that out for themselves, I'd rather have them feel welcome to come back.
I like managers that set up their team for big wins and them make sure they are treated accordingly, both humane work/life balance and with excellent pay. "Fair" pay is fine, but I'm striving to provide an exceptional value. So I think fair pay if I achieve that goal doesn't look like "competitive" or "market rate".
If you strive to 'provide exceptional value', but want to be compensated highly, then the you are not providing exceptional value. Perhaps it should be 'commensurate value'
My dad and stepmother are now-retired developers. I still identify as one, although mostly I manage now, as it has become more important to me to create a context where good work can be done than to do the work directly. I still try to write at least a little code every day, as I love it. So yeah, I appreciate what engineers do. However.
Let's do a thought experiment. Imagine there are only two companies: a good one and a shitty one. At the good one, everybody goes home on time. The code is pretty clean. The people are friendly and supportive. They build good things as part of making happy customers. At the shitty one, though, it's the opposite. It was founded by exploitative dicks. They want everybody to work all the time. They're always rushing, so there's high tech debt and everything's buggy. That means lots of screwed-up schedules and early-morning phone calls to fix production issues. And plenty of shouting and blaming, of course.
Now ask yourself: which company will pay more? Answer: the shitty one. Because if the salary is the same, rational actors will take the pleasant job with the nice people. The shitty company has to pay more.
Years ago I worked for financial traders. I made very good money. I also worked long enough hours that I sometimes slept on the office couch. Too often, I got screamed at by traders, because they liked yelling at people. The work was meaningless; we were just trying to carve off a slight of economic value that other people created. Eventually the work burned me out. It took me a long time to recover.
In the ensuing years I've worked at a variety of places, big and small, for-profit and non-, competent and incompetent. I have learned that there are many more important things to me than money. It's important to me that the salary be fair, both in a mark-to-market and in a results-of-productivity-fairly-allocated way. But beyond that, I care about other things. And so I try to create contexts where I and others can get those things.
If you would rather maximize your income, that is totally fine by me. People want different things. But just because you don't care about work-life balance doesn't mean that the people who do are idiots.
However, terrible places that stay in business are often compelled to pay more. Sometimes they can do that because they exploit their customers. Sometimes it's because they can dump negative externalities on others. Sometimes it's because they cut corners. Sometimes the work is just soulless and extractive.
And sometimes it's just because they are very stingy with non-cash benefits. E.g., I was just talking to someone who had taken 5 months of paternity leave. I have friends who will take 4-6 weeks of vacation per year. I know other people who get a lot of support for education, for speaking at conferences, for learning.
If a company does more of the bad stuff and little or none of the good stuff, they can afford to offer higher salaries. And that's fine. If somebody wants to work at a place like that, godspeed.
As a perhaps more obvious example, consider some equally smart but differently trained people: lawyers. I have friends who joined soulless corporate firms, worked 100-hour weeks for years, and now are doing very well financially. Some started their own small practices doing the kind of law that interested them; they make decent money. Others do public service law for nonprofits, helping people who can't afford to pay lawyers; they make yet less. All of these are reasonable paths, but they pay very differently. If one of the non-profit lawyers gets an offer from a giant law firm, their current employer will not try to match that. Everybody understands that.