Making people redundant is actually a lot of work. Nobody does that "just because". A company that lays off people is in financial trouble or had a merger recently that actually created an obvious redundancy.
Laying off people will not solve the financial problems of a company. You might be next. Or maybe not. But that's not your decision. Somebody will decide your fate at a point of time that is not of your choosing and without your input or consideration.
The only exception to this is if your company was part of a merger and actually has redundancies because of this. Then it might be a one-time occurrence (or at least one time per merger).
So if this happened without a merger taking place, the company is still in financial trouble and you might be next. The question is when not if you are shown the door. Do not let other people decide your fate. Make the decision to switch jobs when you want to do it, not when an accountant at a different branch pulls your file number from a random bucket to save the bottom line.