At initial glance I also think it would be much cheaper to give out adjustments like this than have like 10% of your staff leave. Some napkin math indicates otherwise: if you have a staff of 10 that each make 100k on average, a 5% COLA costs you $50k vs. 1 person leaving (10%) and costing you maybe $25k in recruitment. That $50k is year over year too, not just a one-time deal, your avg salary is now $105k.
So in this fictional, theoretical employer scenario it would take 3 people leaving (30%) in order for it to have been less costly to just have given out 5% to everyone.
Even with my napkin math I still think its better to take care of your people reasonably vs. use a spreadsheet to drive decisions and hope people don't leave.