The second situation is they're hemorrhaging staff, and will counter everyone, or proactively give raises to stem the tide.
I once took a counter offer that was nearly 50% of my salary. That was too much money to turn down.
That's probably how it happened to me. I gave my notice, and people looked worried and had hushed conversations. A couple of hours later, managers from other teams were offering me better roles, but I turned them down, because the reason I was leaving was that I didn't like the way the company had treated me up to that point.
The problem with companies that act like that is that if they believed I deserved a better position, the time to act was when I had made it known I was unhappy, not when I'd already made the decision to leave. I'd already applied for internal promotion a couple of months before, and they could have acted then instead of just never getting back to me.
Nevertheless, it is all the same. If I need to threaten company with leaving (whether with job on hand or in 1:1) in order to be treated better, then I am better off elsewhere.
Many companies treat complains as just whining - they see the goal as letting you talk and have some reassuring speech, not to take action.
He got it, if you're curious.
As strange as it may sound, he was worth all his quirks and more. As for quirks, he had plenty. I've never met a better DBA, however. We were working with full TB data sets by 2000. He enabled that, for the most part.
Walmart was in an article touting themselves as the first to deal with a database a TB in size, he found that greatly amusing. I have trouble wrapping my head around databases, I think he just knew them by intuition.
His choice of office space was one of his more mild quirks. I believe he is still retired but I can safely say he enabled us to do things we'd not have been able to do without him.
Edit: I could probably write whole books about the people who worked with me. Getting started in the early 90s seems to have made quite a difference in the people aspect. I never had an HR department and I'm not sure I could have forced one into the mix.
I'd been the original programmer, except I can't code very well. I eventually hired professionals. They, of course, told me how much my code sucked. They were rather blunt about it and I took the hint and got out of their way.
Eventually, the code to enter the server room was changed at the main office. I could have forced them to give me the code but that seemed unwise. I hired people to do things I could not. If I could do it, I wouldn't have hired them. So, I learned to put my ego aside and get out of their way.
This is long enough, but that's the gist of it.