In economics, the principle of comparative advantage explains how trade is beneficial for all parties involved (countries, regions, individuals and so on), as long as they produce goods with different relative costs. Usually attributed to the classical economist David Ricardo, comparative advantage is a key economic concept in the study of trade.
Adam Smith had used the principle of absolute advantage to show how a country can benefit from trade if the country has the lowest absolute cost of production in a good (ie. it can produce more output per unit of input than any other country). The principle of comparative advantage shows that what matters is not the absolute cost, but the opportunity cost of production. The opportunity cost of production of a good can be measured as how much production of another good needs to be reduced to increase production by one more unit.
The principle of comparative advantage shows that even if a country has no absolute disadvantage in any product (ie. it is not the most efficient producer for any good), the disadvantaged country can still benefit from specializing in and exporting the product(s) for which it has the lowest opportunity cost of production.