For companies like Google, H1B isn’t about bringing into US, it is just an expensive way to satisfy their US hiring hunger.
That difference can be understood by imagining that H1B isn’t foreign devs, instead it is devs grown in a jar by the State Department - Google would buy them the same.