One wonders why employees choose to train their replacements instead of just quit. It seems to me that if a person is so qualified that they are being fired no for cause but just because they are too expensive, they could get another job. It is like complaining that there are no more jobs in the US, but never buying a product made in the US.
Clearly if the visa program did not exist companies would be forced to hire the maybe less qualified US workers, or perhaps open office outside the US. OTOH, I tend to believe that the US is the greatest place in the world, with a great deal of cheap capital, and many people agree. The problem is that people in the US tend to be much more complacent about living up to that greatness than highly motivated people in other countries. It is the greatness of the US that encourages workers to come here, not the ability of employers to pay less. Yes it may lead to the same outcome, but if we look at the former we only complain, but the later gives us solutions.
Here is what happened to me early in my career. At first if was easy because I was competing with the to 5% of the 18-30 year old living in the US, those who had access to technology but also to schools who were more interested in teaching novel skills than the three R's as we used to call them. As the years went on, and more people became computer literate, in the broad sense, not MS Office, then I had to compete with more people. Finally, I was competing with the world, and at that point, since I was not in the top 1%, it all fell apart, so to speak.
Again, when I was a kid the entire engineering class would be hired straight out college. Now one can be in the top 50% and not be hired. It is not just visas, it is not just that technology has made things more efficient, it is also that so many of us are simply complacent about our futures.