The US do not go out and ask China to lend money. The debt that the US Government owes to China is the result of the Government, more specifically the Treasury, issuing bonds. These Treasury Bonds are sold to the public and anyone, including private individuals (including yourself), insurance companies, foreign central banks, etc. can buy such Treasury Bonds.
China is an export oriented economy with a huge trade surplus. That means they export more than they import. As a result, the Chinese export companies will receive US$ to pay for the goods and services that they export.
They need to convert these US$ into the domestic currency, the Yuan (CNY), to pay salaries and raw material. Since China exports more than they import, there will be an excess demand for the domestic currency, pushing the CNY/US$ exchange rate up.
Such an appreciation of the CNY, however, would make Chinese exports more expensive and make the Chines economy less competitive in the international markets. To avoid such a situation, the Chinese central bank interferes in the foreign exchange markets, buying the excess US$ against the CNY, maintaining a constant exchange rate.
This results in massive US$ holdings of the Chinese central bank that they need to invest in the international capital markets. The largest and most liquid market with the lowest risk is the US Treasury bond market. Treasury bonds are issued by the US government to finance the public debt in the US and sold to the public.
As a result of their large currency reserves China became the biggest holder of such Treasury bonds. However, China reduced their holdings in December last year by selling Treasury bonds in the open market. China sold approximately 34.2 billion US$ in December, reducing their holdings of US debt securities to 755.4 billion US$. At the same time, Japan increased their holdings by 1.5% to 768.8 billion, which makes Japan now the biggest foreign investor in US government debt.