At the end of WWII the world was greatly changed and needed a new mechanism for managing trade. The system put in place was the Bretton Woods accord, which provided for settlement of trade between nations on a periodic basis.
The system specified the US dollar as the world reserve currency, where member countries would specify a fixed exchange rate to the US dollar called the "peg". Thus any currency was exchangeable into any other currency by comparing the pegs of the two countries. Most importantly, a provision specified the value of the US dollar in terms of gold, which was set to $35/oz, and the guarantee by the US government that it would convert US dollars into gold on request. The US could make this guarantee because by the end of the war the US had acquired a large reserve of gold. This system essentially specified convertibility of all currencies in terms of gold. The US dollar was pegged to gold and all international transactions could be viewed as made in terms of gold, as any currency could be ultimately converted to gold.
The importance of the peg to gold is the key to this system. Gold is a commodity which has all the properties of a stable currency. It holds value, is acceptable everywhere, is sub-dividable, durable, scarce, and easily transported. These properties are why gold has been accepted as money for millennia everywhere in the world. The peg to gold also means that the value of currency is not set arbitrarily by persons or nations with widely varying interests and goals. The value of currencies are, in a sense, protected from meddling to a great extent.
To manage this new system two institutions were set up, the IMF and the World Bank. The IMF was tasked with managing the exchange of currencies and the settlement of trade deficits. The mechanism put in place is somewhat complicated involving subscriptions to the IMF and loans of foreign currencies, thus allowing member nations to run trade deficits for a few years at a time. Nonetheless, despite these loans, the nations would ultimately need to settle ether in gold or member foreign currencies which was typically the US dollar.
Member nations that had balanced trade would see the inflow and outflow of their national currency equal out and their account at the IMF was stable. These nations were free to print their own currency in whatever amount they wanted, but when that currency was used for foreign purchases it would need to be repatriated via the IMF settlement system. Thus the debtor nation would either have to rebalance its trade or pay into the IMF gold or foreign currency.
The main effect of the Bretton Woods mechanism was that trade was continually balanced. If a deficit occurred for one nation, it was settled by transferring foreign currency or gold to the surplus nation. The currency transferred was convertible to gold, so the settlement was the same as sending gold from the deficit nation to the surplus nation. In other words, its as if the deficit nation executed a true trade of its gold for the imported goods with no currencies involved. After the gold is transferred the trade is settled, and the accounts are balanced. Note that no nation had to accept a foreign currency based on good will or faith because all were ultimately backed by gold.
So what happens if a nation perennially runs a trade deficit? In this case, through the machinery of the IMF that allows some delays in settlement, the deficit nation will steadily over time transfer gold to the surplus nation to settle its trade deficit. The trade will be settled and the accounts at the IMF balanced. Eventually, the deficit nation will run low on gold, what happens then? Well, if you're a small country you are in trouble, although the IMF is supposed to intervene before that becomes a problem with various programs and policies to restore a balanced trade. But, if you are the USA which is the dominant economic nation on earth and your currency is the reserve currency for the whole system, the result is somewhat different. This is exactly what happened to the US, it was running low on gold by the end of the 1960's.
What did the US and IMF do? Instead of rebalancing trade or continuing to transfer gold out of the US, the US government made a fateful decision, one that we operate under to this day. In 1971, the US decided to withdraw from the Bretton Woods system that it had set up and let the US dollar float on the, small but now rapidly growing, international currency exchange market. The US dollar was no longer pegged to gold at a fixed rate, and the exchange rate of the dollar to other currencies varied daily. This was the "free market" solution which proponents believed would allow the market to determine the value of currencies relative to each other and ultimately result in balanced trade as the values adjusted accordingly.
Unfortunately, it hasn't quite worked out that way. Forty years later and the US is still running a massive trade deficit that is vastly larger than back in 1971. The cumulative of these deficits, the trade debt, now totals nearly $10trillion!! This is $10trillion of unsettled trade. That's a lot of trade deficit to resolve. Perhaps this deficit has something to do with the loss of millions of manufacturing jobs in the US over the last few decades? The "free trade" system clearly is not working for floating currencies, and a return to a Bretton Woods system is needed to restore settled trade among nations.