You can look at it this way. The United States borrows money by selling bonds. Anyone can buy those bonds, and they're considered to be safe investments because the United States has not yet defaulted on paying back those bonds. As a result, the interest rate on those bonds is quite low.
China happens to wisely invest its money by buying lots and lots of US government bonds along with everyone else. China owns a large amount of those bonds, but many of those bonds are owned by other countries, individuals, and financial institutions. It's not like the US went directly to China and signed up for a loan, so it's a more general bond-issuer, bond-holder relationship and not a bank loan type of relationship.
The United States can't just choose to not pay back just China and it can't choose to loan money just from China. The debt goes to whoever buys the bonds, and the US government either pays up when bond holders redeem their bonds or it doesn't.
So if China decided decided not to loan any more money, it would just stop buying US government bonds. Presumably, other investors would fill in the gap by buying more bonds. If the bonds could not be sold, the US government would either have to issue bonds with a higher interest rate, attracting more investors, or reduce its spending.
If the US government became so dysfunctional that decided it can't pay back its debts, all bond holders would suffer, not just China. In that scenario, the interest rates on future US bonds would increase drastically, otherwise no buyers could be found. The value of current bonds would drop drastically, since there would be much less confidence that those bonds could ever be redeemed.
Remember, it's not a bank loan type of relationship the US government has with China, it's a bond investor type of relationship, and there are a lot more investors than just China.