The U.S. is using debt to pay for current expenses. This is enabled by this foreign investment. Roughly, China's offer over the past twenty years has been the following: "You guys are pretty good at making things, but we're young and hungry for the job. You go home and relax while we do your job, and we'll just loan you the money you would have earned. Good deal, huh?"
The only problem is that eventually they will start seeing us as a bad credit risk, stop loaning the money, and we're left with a pile of debt, some broken appliances, and no recent skills. They wind up with some bonds that they may have to write off, and a highly skilled workforce and a huge industrial base.
But if the US really did need to do all that accounting then how come they've accumulated a debt of 20 trillion?
I'm not saying that the US economy is completely immune, but they certainly seem more immune than other economies.
One day the President is complaining about the trade deficit and the next he's saying the US needs more foreign investment. I don't think you can coherently hold these grievances together. But if foreign investment is good right now, then the trade deficit must be good.