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.