If you're on the verge of being laidoff or laidoff, and are looking internally for an opportunity, the irony is that you will never get hired into a higher position than where you are currently at, not matter how close you were to getting promoted. Let's say you are a Senior Software Engineer for the past 6 years and almost ready to get your promotion to Staff, but your group gets axed. Guess what? You will have to start all over again as a Senior Software Engineer at some other group (or worse, be forced to take a lower position because you are desperate).
On the other hand, if you leave the company before you get laidoff, chances are the other company will give you a equivalent staff position. After maybe 1-3 years, you're chances are much better getting hired back into QC as a staff engineer externally much sooner than it would take you to reach staff by starting over internally within another group and waiting another 6+ years (speaking from experience, of course).
That's why you see so many senior software engineers that's been "stuck" in that position for the past 12+ years. The implications of this well proven knowledge is left as an exercise to the reader, especially the ones that have outstanding offers from companies like cough mediatek or intel cough