Economics articles/textbooks often talk a lot about "developing countries not exporting enough to have enough foreign currency to finance their imports". This is something I have never really understood. Does this mean an exporter is paid in foreign currency? How then, does this foreign currency make its way to an importer? Can an importer still import if there is no foreign currency available from the current or capital account?
I have also read statements like "The U.S. trade deficit with China has flooded China with dollars, allowing them to lend back to the U.S.A.". Why do Chinese firms not exchange these dollars for domestic currency? If they do... who then receives the dollars and then invests them back into the U.S?
All nations must, of course, pay for their imports. Goods offered for sale by producing companies will either be priced in the local currency, or in a stronger currency, such as the American dollar or the Euro. This makes the foreign exchange for the producing country more stable. As an example, the very poor African nation of Malawi has only one really valuable export product, which is tobacco. Their tobacco is offered for sale in U.S. dollars. Their own currency is wildly volatile by international standards, because it fluctuates on the basis of their government policies, the amount of their foreign exchange (how many dollars they get in selling their tobacco), their trade balance (whether they take in more money on exports than the pay for imports, or whether the lose money on those exchanges--which is usually the case). The United States dollar, however, is one of the most stable currencies in the world. Both those who buy Malawi's tobacco, and those who sell Malawi products they don't produce (petroleum products, manufactured goods and a good deal of food stuffs) will know in advance how much it will cost them, or how much they will earn by selling their goods. It is in Malawi's interest to have the relative stability in foreign exchange--when costs and earnings are uncertain, those who sell to Malawi will charge more, a good deal more, to protect themselves from loss. Pricing their tobacco in U.S. dollars and paying for imports in U.S. dollars provides that stability, and saves them the premiums they would have to pay if they attempted to use their own currency.
While it is true that Malawi spends more than it earns, a good track record of paying their bills in a stable currency means that importers are willing to wait for their money, and might
be willing to extend credit. This is no different then the environment in which small businesses operate within their own national economies. If you run a small business, and have a good track record of paying your bills, you suppliers are unlikely to charge you a premium for your purchases, and are more likely to wait for their money. This is simple, common business practice, and has been for centuries.
So small and poor economies like that of Malawi operate in much the same way on global markets as small businesses do within their national economies.
Cash does not actually change hands. It is easy to find out how many U.S. dollars Malawi has, and it is in the interest of the government there to be up-front, to be transparent about that. International trade operates on what one might call "wire transfers" (bills of exchange have been offered, traded and verified by telegraph at one time, and now by electronic means, for well over 150 years). If Malawi wants to buy petroleum from Saudi Arabia, the Saudis will simply review their payment history (do they pay their bills reliably? how long does one usually have to wait?) and the record of Malawi's foreign exchange transactions to decide how much they will charge, and, of course, whether they will make the sale at all. Saudi Arabia wants to sell their petroleum for obvious reasons, and needs to buy foreign goods like any other nation. These are all common business practices identical to those within national economies, but on a global scale.
I cannot tell you how the Chinese economy manages foreign exchange, it's not something which has ever interested me. It would not be unreasonable to assume that those who receive U.S. dollars simply deposit their money in Chinese banks, or with the government, either of which will deal with the foreign exchange.
In the days after the collapse of the Soviet Union, Russia was flooded with U.S. dollars--not traditional foreign exchange recorded in ledgers, but the actual paper currency. It was the only thing Russians would trust outside the rather limited use of rubles in the internal economy. In 1996, the United States changed the appearance of their paper money (and took steps to make it very difficult to counterfeit). Russians quickly became paranoid--changing the currency was one way Soviet authorities (and before that Imperial authorities) could skim cash from the population. I recall an official of the American embassy in Moscow going on television to assure people that a hundred dollar bill is a hundred dollar bill is a hundred dollar bill, no matter what it looks like. He was clearly mystified by the paranoia. The U.S. dollar has been a stable currency since the Washington administration when Alexander Hamilton stabilized the U.S. currency and specie (gold and silver coins) by paying off the foreign debts of the states and establishing foreign trade policies with European nations. That poor guy at the embassy probably couldn't understand what the Russians were worried about.
This article from the University of British Columbia explains foreign exchange in a reasonable manner