How did the First World War transform the US economy

How did the First World War transform the US economy to make it an international creditor from an international debtor?

The First World War was the first industrial v war. It saw the use of machine guns, tanks, aircraft, chemical weapons etc on a massive scale.
Britain borrowed a large sum of money from US banks as well as from companies to pay off loans. At the end of the war, Britain was burdened with huge external debts. US witnessed an industrial boom and increase in agricultural production.
The US was thus in a position to lend to European countries. As a result, US emerged as an international creditor from being a debtor earlier.