Been through a couple of layoffs at a variety of different companies through out my career and personally managed to dodge the bullet each time (so this isn't a sour grapes type response). It is very important to recognize: who gets laid off has
nothing to do with whether or not they are a "good worker".
The "good worker" narrative is there to justify management's decisions and reduce survivor's guilt, but you'll see when layoffs come amazing talent and mediocre talent are equally removed. Management has zero problem laying off incredible people en masse.