Why countries trade
Countries trade because they have different resources, skills, and climates, making some better suited to producing certain goods than others. The theory of comparative advantage says a country benefits from specializing in producing goods it can make at a lower opportunity cost than other countries, and trading for the rest -- even if another country could produce everything more efficiently in absolute terms.
Example 1: Country A can produce either 10 units of cocoa or 5 units of cloth with its resources; Country B can produce either 6 units of cocoa or 6 units of cloth with the same resources. Which good should Country A specialize in?
Country A's opportunity cost of 1 unit of cocoa is 0.5 units of cloth given up, while Country B's opportunity cost of 1 unit of cocoa is 1 unit of cloth given up. Country A has the lower opportunity cost for cocoa, so it has a comparative advantage in cocoa and should specialize in producing it, trading with Country B for cloth.
Trade barriers
A tariff is a tax on imports, making foreign goods more expensive and protecting domestic producers from foreign competition. A quota directly limits how much of a good can be imported, regardless of price. Both barriers protect domestic industries but tend to raise prices for consumers and can invite retaliation from trading partners.
Exchange rates and balance of payments
The exchange rate determines how much of one currency is needed to buy another; it affects the relative price of a country's exports and imports. The balance of payments records all transactions between a country and the rest of the world, including trade in goods and services, investment flows, and transfers -- a useful summary of a country's overall economic relationship with the rest of the world.