Cross currency swaps and FX swaps encompass structures which allow investors to raise funds in a particular currency, e.g. the dollar from other funding currencies such as the euro. For example an institution which has dollar funding needs can raise euros in euro funding markets and convert the proceeds into dollar funding obligations via an FX swap. The only difference between cross currency swaps and FX swaps is that the former involves the exchange of floating rates during the contract term. Since a cross currency swap involves the exchange of two floating currencies, the two legs of the swap should be valued at par and thus the basis should be theoretically zero. But in periods when perceptions about credit risk or supply and demand imbalances in funding markets make the demand for one currency (e.g. the dollar) high vs. another currency (e.g. the euro), then the basis can be negative as a substantial premium is needed to convince an investor to exchange dollars against a foreign currency, i.e. to enter a swap where he receives USD Libor flat, an investor will want to pay Euribor minus a spread (because the basis is negative).
Both cross currency and FX swaps are subjected to counterparty and credit risk by a lot more than interest rate swaps due to the exchange of notional amounts. As such the pricing of these contracts is affected by perceptions about the creditworthiness of the banking system. The Japanese banking crisis of the 1990s caused a structurally negative basis in USD/JPY cross currency swaps. Similarly the European debt crisis of 2010/2012 was associated with a sustained period of very negative basis in USD/EUR cross currency swaps.
What had caused these dollar funding shortages? Financial globalization meant that Japanese banks had accumulated a large amount of dollar assets during the 1980s and 1990s. Similarly European banks accumulating a large amount of dollar assets during 2000s created structural US dollar funding needs. The Japanese banking crisis of 1990s made Japanese banks less creditworthy in dollar funding markets and they had to pay a premium to convert yen funding into dollar funding. Similarly the Euro debt crisis created a banking crisis making Euro area banks less worthy from a counterparty/credit risk point of view in dollar funding markets. As dollar funding markets including FX swap markets dried up, these funding needs took the form of an acute dollar shortage.
What then is causing the negative basis currently? The answer is monetary policy divergence. The ECB’s and BoJ’s QE coupled with a chorus of rate cuts across DM and EM central banks has created an imbalance between supply and demand across funding markets. Funding conditions have become a lot easier outside the US with QE-driven liquidity injections and rate cuts raising the supply of euro and other currency funding vs. dollar funding. This divergence manifested itself as one-sided order flow in cross currency swap markets causing a decline in the basis.