Because there are some H1B workers that come over as translators or other non-tech professions. Like if you need a translator that speaks Swahili for some NGO it's way easier to hire a native Swahili speaker than possibly finding a qualified American that also speaks Swahili.
I do find it interesting that these trillion dollar companies can't find domestic workers, at their level of wealth they should simply be forced to pay for the education of Americans to create a funnel of workers rather than exporting this societal need to other nations.