Bosses who want to cut headcount without layoffs can do so by just not replacing people who quit - if nobody's quitting, that's not possible.
Things like training schemes might have been sized on the assumption you'll have >100 open positions in a year's time, when these 100 trainees finish the scheme. Firing them instead is not good for anyone involved.
Bored star employees can't move teams if other teams don't have open spaces.
And some people think constant employee movement stops teams becoming 'stagnant' as job hoppers sometimes bring in experience, ideas and methods from outside.
First, and probably the largest motivator, is that if you fire someone without cause they will typically be able to collect on unemployment insurance which would increase the employers premiums each month.
Second, nobody likes to fire people especially if they haven't done anything wrong. Also, layoffs like this hurt the moralle of the remaining workers which could turn into too much turnover.
Having someone quit is usually preferable to increasing costs and hurting moralle, but that will not stop businesses from doing what they feel the need to do.
Just to quickly clarify on this, firing someone for advocating for a union is illegal regardless of their protected status, employee organization is itself a protected activity.
If a business ever does get into hot water over something this, I would very much advise against saying to a judge, "no, our decision to fire had nothing to do with discrimination, we were merely retaliating against an employee for organizing."
And the reason can be as simple as “no business need to continue employment”. And you can sue for anyone for anything at anytime, but it does not mean you will get anywhere, except losing money on court fees or lawyers.
The only direct monetary cost to employers is increased unemployment benefit insurance premiums due to having more previous employees collecting unemployment benefits.