High quality developers from these countries can get paid surprisingly well. The ones that are insanely cheap tend to also do poor work.
The reason we still plenty of work being outsourced is because if you have a really high tolerance for low quality work, the lower end is much cheaper than you can get in the US.
You are also wildly underestimating some of the tech markets. I know plenty of people that are heading back to China because they are being offered amazing positions over there.