Generally, it is often assumed that a trade surplus is good for a country whereas a trade deficit is bad. This should be better put into context and sound something like: Trade imbalances are always negative in the long run, but a trade surplus might be considered the better of two evils. Why is that so? What are trade imbalances and where do they come from?
Let’s start with explaining the whole matter in an illustrative way. Imagine there are only two countries in the world that interact and trade with each other. Country A exports more than country B, thus has a trade surplus and country B has the opposite position, exporting less than it imports resulting in a trade deficit. However, the story does not end here, the trade balance is only part of something bigger, the balance of payments. The balance of payments has to balance at all times very much like a regular balance sheet of a corporation. As a result, country A has to buy something from country B to offset the surplus in trade. This happens most often in forms of investment, may it be in government bonds, stock, housing, etc. Simplifying things, country A gives a sort of loan to country B in exchange for country B buying the products of country A. If you feel like that is the same as if your retailer of choice allows you to buy its products on credit, you are not that far from the truth. Your retailer likes it, because he can sell his production off more quickly and you, well you are just happy to possess whatever you have purchased.
But back to our trade deficits. If a country runs trade deficits for an extended period of time, it will inevitably face troubles. It becomes very dependent on foreigners’ willingness to keep buying assets. If they stop doing so, country B’s currency will drop significantly. For the country running surpluses, the risk is simply that their export market breaks away when its currency appreciates significantly making its goods more expensive abroad. In addition, a devaluation of country B’s currency, decreases the value of the investments country A has made in country B. You might have noticed, devaluation of the currency is tossed quite often. The reason is that after a while this will almost inevitably happen. It is important to understand that the mechanism to re-balance trade accounts is through currencies. If imports become too expensive, they will decline and after a while there will be no trade deficit for country B anymore.
To sum it up, trade imbalances have to even out in the long run and cannot exist forever. The adaption for both countries can be painful. The country with a trade surplus loses part of their investments and their markets break away. The country with a trade deficit weakens its currency and becomes dependent on foreign capital. By the way, if you know a bit about international capital flows, you can replace country A with e.g. Germany or China, and country B with the U.S. or the U.K. There are some interesting views on on trade imbalances between China and the U.S. available.