It cuts both ways. Most people in the industry jump after 2 years for better pay, or to a startup. How many people stay on for 5, 10 years? Why would you spend 50-100K training someone just so they can leave and work for your competitor or anyone else just because the pay's better? There's a reason besides cost savings that companies stopped training their employees and choose to incur the extra cost of getting more experienced individuals.
I mostly agree with GP (the AC, not GGP) in that, if you're good, you're always in demand, and can make a good living. Especially in this current market, there's no reason anyone who's good can't find a job other than that person isn't looking hard enough. If you're not that good, sorry, can't help you there. You should try to aim lower. Or shoot for something a little different. Now, you might not necessarily do as well as GP, but then again, you don't know what GP's qualifications actually are.
As a US citizen working a tech job, I don't see H1B's as competition. I do see offshoring as competition, but with respect to the tech sector, only for the menial and uninteresting jobs that I probably wouldn't do, or would quickly graduate from anyway. There'll always be cool stuff here, if you're good enough for it. I do blame the general state of the education system for producing poorly educated people with no understanding of fundamentals and little ability to think for themselves, but that's a completely separate and much bigger issue and IMHO, a conspiracy orchestrated by the people in power to kill the middle class. And if you agree with that last statement, then the solution is not to whine or rail against foreign talent, but to better yourself and if not possible, then sorry, that's life; suck it up and better your children instead.