Illegal workers can also get a
ITIN (same as a SSN, but intended for non-residents, including illegals, not eligible for SS etc.).
A dairy farm near me hired illegals, because it's who would do the work reliably. He was audited, the IRS dinged him for not withholding payroll taxes, he explained they weren't legal, and IRS required him to get a ITIN for those workers. The employer has to pay the same taxes as for residents, but the workers get no benefit, but it's a good thing because it levels the field between legal workers and illegals for purposes of payroll taxes.