This has nothing to do with jobs and their security at all. When a company lets staff go, the announcement of that has a direct effect on the stock price. So basically when the stock price is in danger to go down, they let staff go to stabilize it.
Next time a company announces this watch the stock price. It jumps up usually by about 1-3%.
None of these companies give a damn about any employee who they can lay off.
Doesn't matter how hard you work.