The reason China is able to do this is because U.S. visa laws are so backward. As we kick these highly skilled foreign-born workers to the back of the visa line, China says: "You don't want them, so we'll take them." Whatever its other faults, at least China has a national strategy to lead the world's technology sector.
Meanwhile, the United States has no national strategy. For starters, we should reform our visa laws to attract the world's best and brightest. We must also keep pursuing free-trade agreements to open markets around the world. Finally, we need to stop our suicidal overspending.
China has a long way to go before they can claim the title of the world's technology leader—giving its citizens open access to the Internet would be a good start—but they are making many sound moves in that direction. Attracting foreign firms, respecting intellectual property, and engaging as a good faith partner in the world trading system would solidify its chance. By the way, that's not a bad strategy for the United States to follow either.