Some companies have written policies to pay you for several months after a layoff (my megacorp does, and paid it out after a small layoff round in January). So there's some loyalty at least for existing employees.
There is the calculus that the PR and legal costs are not entirely predictable and could be higher, so why the the risk if we have the cash.
If you are at a megacorp, you are a number, and a variable in a bunch of spreadsheets. Nobody cares about you beyond that.