About 12 years ago I was working for a PC Magazine competitor when they cut the Managing Editor loose, a man who'd worked there 20+ years and was in his late 50s. I ran into him in the bathroom, tears in his eyes, asking me what he was going to do now? That this is how they reward decades of loyalty? Ironically that magazine, dedicated to predicting future technology trends, would go down the toilet some years later…
"Companies have no loyalty folks...neither should you." That's a broad brush to paint with; companies are just a group of people, not some inhuman construct. People make the decisions and just like every other aspect of life, some people care don't put their impact on others first, or can't because of circumstances. Not every company discards employees like garbage, and it's a lousy narrative to propagate.
Unless you have a contract with a golden parachute, anything could happen in a moments notice. Very few people outside of senior management have such parachutes, and even then not all of them negotiated for a good one.
If nothing else, keep your resume and linkedin up to date.