Person X at $100k is given ... $40k to quit now, because it will save company perhaps $260k in the next 2 years. But.. that $40k is coming from somewhere now, no? Maybe some is coming from other folks cut immediately without the big pile of cash?
It's generally cheaper to make a single larger payout than to engage in recurring smaller payouts.
Most large companies set aside money for layoffs in their financial filings under one-time expenses. They will usually explain what impact the layoffs will be expected to have on profitability.
I frequently see short-term decisions to get funding triumph over long-term planning when private investors are involved. And it might even be the right choice - grow and get all the funds, then clean up tech debt in future years. It can be frustrating, but is a valid business play.
Ditto with layoffs. 2-3 months salary to get rid of employees you can’t afford at the moment is a short payoff compared to salaries, and worth it to salvage some reputation for future hiring.
No such power imbalance exists with an employee joking about quitting, but I also struggle to think of any situation in which it's actually a funny joke to make.
Boss, to employee: "I'd just like you to know that I'd never joke about firing you. I recognise that it would be needlessly cruel because, although you're reliant on the company to earn a living, the company would actually be better off without you." D:
The truth it: neither of them is a joke. It's just pure BS that comes either out of sheer and innocent incompetence or stupidity.
A good rule of thumb is "don't make gambles where the best-case scenario is that nothing bad happens."
I think that another way to prevent it is by asking yourself if the other person will find it funny.
That's a general advice not just specific to firing/leaving a company.