Raises are subjective judgements, which are scary things. Word gets out that raises were given and everyone is looking for something. Also, HR often doesn't trust the managers. Is the manager rewarding good work? Or building an empire?
Incentives are always aligned with short term goals. If you give someone a raise, you're fucking up some KPI the HR guys cares about. If an employee quits and the company spends more, its either the former employee or the manager fault.
There is little industry agreement on what titles mean (SR engineer, for example isn't universally the same job).
And...both sides are incented to either over or under state market rate.
Fundamentally, you are worth whatever someone will pay you. If you can negotiate an offer for 20% over market rate, congrats, that's your personal market value. Conversely, if you're currently paid 20% under market value and can't find another job, the same applies.
Rinse and repeat, and the cycle gets shorter, and the problems get bigger