Even paid identically, a company might prefer H1Bs for retention purposes. Having an indentured serf who's difficult for other companies to hire and is at constant risk of deportation if they lose their job is a winning prospect for the worst companies.