Based on what my engineering manager seems stressed about and has his calendar filled with, it is hiring. I'm surprised that the high rate of turnover in tech is not considered a crisis given all the time he spends on that. Even assuming that employee tenure is worthless, a senior level engineer loses 1/3 of his time to this.
It doesn't make any sense that you have to leave your job to get a big salary raise. Surely you're a lot more valuable to a company with two years' of experience in a codebase vs. a new company with no experience.
When you're being hired both you and the company are taking a bet. The company is betting that you're worth $x+$y/year, where $x is the salary and $y is bit extra to accommodate the risk that you aren't, you're betting that it's worth working for the company for $x-$z/year, where $x is the salary and $z is a bit extra to accommodate the risk that you aren't. I.e. both sides price in risk.
After a year or two, the risk on both sides has largely evaporated. The company now knows that you are (or aren't) worth $x+$y, and you know that it actually is (or isn't) worth working for the company at $x-$z.
There's now a delta between $y and $-z (assuming the initial estimates were accurate) where it "makes sense" for you to stay, the company could pay you more, but why would they? If it wasn't for the fact that shrinking salaries is a negative experience for the employee (more negative than the dollar difference) they could also pay you less. Splitting the difference by not changing the salary at all seems fair, and nicely lines up with the agreement you already have in place.