how do countries end up with a trade deficit
Balance of trade If a country exports a greater value than it imports, it has a trade surplus or positive balance, and conversely, if a country imports a greater value than it exports, it has a trade deficit or negative balance. The notion that bilateral trade deficits are bad in and of themselves is overwhelmingly rejected by trade experts and economists.[2][3][4][5][6]
Tax treaty Many countries have entered into tax treaties (also called double tax agreements, or DTAs) with other countries to avoid or mitigate double taxation. Such treaties may cover a range of taxes including income taxes, inheritance taxes, value added taxes, or other taxes.[1] Besides bilateral treaties, multilateral treaties are also in place. For example, European Union (EU) countries are parties to a multilateral agreement with respect to value added taxes under auspices of the EU, while a joint treaty on mutual administrative assistance of the Council of Europe and the Organisation for Economic Co-operation and Development (OECD) is open to all countries. Tax treaties tend to reduce taxes of one treaty country for residents of the other treaty country to reduce double taxation of the same income.