H1-B covers both folks who are based outside the US when they were recruited and students who graduated from US schools and transitioned from F1 (student visa) to H1-B. If you go to computer science/STEM departments (at least for the top schools), you will notice that a significant portion of them are foreign students. It is thus not surprising to see a lot of being hired.
Also, foreign students being hired after graduating from US schools are very much less likely to be cheated upon when it comes to pay.