https://www.vice.com/en/article/n7z5px/twitter-employees-on-...
I would imagine a lot of the H1 b visa holders are there just to let their visa run out while making some money.
Anyway it doesn't matter. This isn't and engineer problem. It's a management problem. The management is the definition of incompetent.
It is easier with other tech companies because unlike Musk they are/were generous severance time so those probably got 90+ days in severance time and the 60 days with say FAANG layoffs.
Also switching jobs can set them back on their path to permanent residency application timelines , depending on the country of citizenship that could be adding some years to continue on H1B and this dependency cycle so people close to their PR may try to stick it out
No one gets deported per se, most undocumented immigrants are people who fly over and overstay their visas, the USCIS will not check anything when they leave (by design so no one worries about leaving) however if they overstay the visa, it will be a tough time entering again , very likely to be rejected at the border or new visa application would be denied.
Facebook was reportedly ~15% H1B workers. It doesn't take a lot of skew in who was fired and who didn't leave for other employment for Twitter to be >50% H1B at the moment.