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.