I've always wondered how much value employers lose via this sort of error. 'Reactive' compensation absolutely does drive people away, for good reason. Retaining employees by matching outside offers is even worse; outside the very highest levels it fosters instability and encourages people to interview elsewhere.
So sure, your employer saved ($X annually * years without raise). But then they lost an experienced employee, likely to a competitor, had to go through a new search-and-training period, and quite possibly had their prior crappy salaries on Glassdoor driving away candidates.
I assume it's a net win sometimes, but I strongly suspect it's often a short-term tactic that ends up not only mistreating employees but losing money.