It might seem counter-intuitive, but often businesses lay off the high-performing-but-best-paid people because that drives the biggest savings while reducing the vanity headcount metric less, especially in companies where the effort of the team greatly outweighs any individual. They assume (sometimes rightly, sometimes wrongly) that the team will carry on without the 'superstar' people. There's also an assumption that the best people will leave when there's a layoff (mostly rightly), so getting rid of them means maintaining control of who's gone.
There should never been an assumption that you're safe from layoffs because you're the highest performing person on the team. Sadly.
The highest paid ones were usually the ones who job hopped the most during the times of economic boom. They added little value where they went as their tenure was too short, but the market was hot they leveraged that to increase their TC.
Some of them did get fire and are having trouble finding a job that paid as well as the last one.
It was a risk they were willing to take and I believe in some cases it paid off.
Many of these engineers have been hired for new business units that didn't end up being profitable with cheap credit going away. Others might be in business unit that is purely a cost center.
Nothing has really changed over the past few decades. Regardless of your role strive to be part of the company that produces the company's profit. Try to avoid parts of the company that are viewed as cost centers and are constantly under the eye of finance as they manage costs. You will find how are you treated in good and bad times radically different.