Suppose for example we have two countries of equal size, Northland and Southland. Both produce and consume two goods, Food and Clothes. The productive capacities and efficiencies of the countries are such that if both countries devoted all their resources to Food production, output would be as follows:
Northland: 100 tonnes
Southland: 200 tonnes
If all the resources of the countries were allocated to the production of clothes, output would be:
Northland: 100 tonnes
Southland: 100 tonnes
Assuming each has constant opportunity costs of production between the two products and both economies have full employment at all times. All factors of production are mobile within the countries between clothing and food industries, but are immobile between the countries. The price mechanism must be working to provide perfect competition.
Southland has an absolute advantage over Northland in the production of Food. Both countries are equally efficient in the production of clothes. There seems to be no mutual benefit in trade between the economies. The opportunity costs shows otherwise. Northland's opportunity cost of producing one tonne of Food is one tonne of Clothes and vice versa. Southland's opportunity cost of one tonne of Food is 0.5 tonne of Clothes. The opportunity cost of one tonne of Clothes is 2 tonnes of Food. Southland has a comparative advantage in food production, because of its lower opportunity cost of production with respect to Northland. Northland has a comparative advantage over Southland in the production of clothes, the opportunity cost of which is higher in Southland with respect to Food than in Northland.
To show these different opportunity costs lead to mutual benefit if the countries specialize production and trade, consider the countries produce and consume only domestically.