A few months ago, I came very close to being deported due to the business unit I worked in being divested to another company - this isn't a problem for H1B employees, but I had an L1 which is non-transferrable to a new company, and since my job at my existing company was no longer present I would be made redundant if I couldn't get employment at the aquiring company. Luckily for me, my residency application became current 2 weeks before the aquisition closed (I had been waiting on this application for almost 3 years), so I was able to move into another immigration status that allowed me to move over to the acquiring company.
If that hadn't happened I would have been left with no job, A pregnant wife (who would also lose her job - as her work auth is tied to my visa) and facing an expensive move back to NZ (relocating a family internationally is really expensive btw). Fortunately for me I'm now on the home stretch (I hope) and I check my mailbox religiously waiting for the day my greencard turns up, and I can start living life on my own terms.