Imagine a world with two countries. If one country has a current account surplus, the other must have an equal and opposite current account deficit. More generally, the sum of the current account balance, of all countries, is zero.
But what about the world's balance of payments? Many economists assume these must also sum to zero. For example, one often hears the claim that if one country is running a balance of payments surplus then others must be running deficits. Another argument often heard is that the RMB cannot become a reserve currency until China stops running a balance of payments surplus, because otherwise other central banks will not be able to acquire RMB assets.
This is wrong. In fact, if the right conditions come together, every country of the world can simultaneously run a balance of payments surplus.
Once a country starts trading on the currency market, the identity between the current account and the financial account breaks down. As an example, China runs a surplus on both the current and capital accounts. (That's how it is piling up so much reserves). Thus, when even one country in the world is trading on its own currency market, it is no longer the case that the balance of payments of the world have to add up to zero.
Does the accumulation of reserves by one country imply a loss of reserves by another? Consider the following two country example. Let's say the two countries are the US and China, and lets assume that the RMB and dollar are both reserve currencies. Let's say that the currencies are pegged at 1:1, so it doesn't matter if you are talking about RMB or dollars. And let's say that trade is balanced, so we can ignore it.
The US government now sells a 100 bond to the PBOC. And the Chinese government sells a 100 bond to the Fed. This yields a balance of payments surplus of 100 in both countries. Reserves went up by 100 in both countries. In both countries the economy (outside the central bank) has imported 100 in capital by selling bonds. So, the financial account in each country shows an inflow of 100, creating a surplus of 100.
What is going on? In this example, the central banks are inflating reserves by exchanging assets -- I buy your government's bond and you buy mine. But we call this a balance of payments surplus (in both countries) because we draw an arbitrary line, above which we record the government part of the transaction (inflow of fx from the bond sale) and below which we show the offsetting central bank transaction (outward investment). Since the assets are accumulating to the central bank in each case, we say that both nations are running BOP surpluses.
When countries do this, all countries can run a balance of payments surplus at the same time. Admittedly, this will be difficult for countries running current account deficits and facing capital outflows. But it is, technically, possible. That's why, say, China has been able to build up $3 trillion in reserves without any major country losing reserves at all.