Trade among nations is ultimately based on comparative advantage. The theory of comparative advantage is an economic theory about the potential gains from trade for individuals, firms, or nations that arise from differences in their factor endowments or technological progress. In an economic model, an agent has a comparative advantage over another in producing a particular good if he can produce that good at a lower relative opportunity cost or autarky price, i.e. at a lower relative marginal cost prior to trade. The closely related law or principle of comparative advantage holds that under free trade, an agent will produce more of and consume less of a good for which he has a comparative advantage.