This really depends on the company you work for, I've had several increases of salary at the same employer, just because I asked for it and had some good arguments. It costs way more money to get a new employee than it will cost to give an existing employee a pay raise.
For a single employee, yes. But across the organization, it saves money to not give any significant raises, and just suffer the attrition. For every malcontent that leaves because they want more money, there's 9 others who just stay and put up with it year after year. Besides, hiring doesn't cost much: they already have HR staff on the payroll to handle that, so it gives them something to keep them busy.
Finally, many companies like to have a certain amount of churn. Bringing in fresh people helps keep the skillsets up-to-date since new employees bring the stuff they learned from their previous employers. If you just have the same staff for decades, they get stagnant.