Undocumented workers do generally pay taxes. The IRS knows all the numbers and makes sure they add up right, but it’s harder to verify that individual people are actually legally allowed to work and haven’t bought some dead person’s SSN or something. (And immigration enforcement isn’t the IRS’s job).