The ability of one economic actor (an individual, a household, a firm, a country, etc.) to produce some particular good or service at a lower opportunity cost than other economic actors can. That is, the economic actor with a comparative advantage can produce the particular good or service by giving up less value in other goods or services that he could otherwise produce with his labor and resources than the other economic actors would have to give up in producing that same good or service. This perhaps can be made clearer by a hypothetical example:

Suppose both individual A and individual B are able to produce two valuable goods called "widgets" and "whatsits." For Mr. A, producing one widget requires ten hours of labor and producing one whatsit requires thirty hours of labor. For Mr. B, producing one widget requires five hours of labor and producing one whatsit requires ten hours of labor. (To keep the example simple, let us assume that both Mr. A and Mr. B each use up precisely the same amount of capital and materials when they are making the same product.) Since every hour of labor devoted to making widgets is an hour that cannot be used for making whatsits, and since there are only so many hours of working time available per month, both Mr. A and Mr. B face trade-offs in allocating their working time between the two possible activities: making more widgets means making fewer whatsits and vice versa. But the precise numerical trade-offs the two face are different. For Mr. A, every additional whatsit he produces "costs" him the three widgets he could otherwise have made in the necessary thirty hours. For Mr. B, every additional whatsit he produces "costs" him the two widgets he could otherwise have made in the necessary ten hours of labor. Because Mr. B only has to give up two widgets per whatsit, while Mr. A has to give up three widgets per whatsit, Mr. B is said to have a "comparative advantage" in whatsit making. (By the same token, Mr. A has a "comparative advantage" in widget making, since he only gives up 1/3 of a whatsit for every widget he makes, whereas Mr. B gives up 1/2 of a whatsit for each widget.)

Note that an economic actor can display a comparative advantage in the production of a particular good even when the other actor happens to have an absolute advantage in producing the same good. In our particular example, Mr. B is evidently much more efficient in making both products than Mr. A is. (In any given period of time, Mr. B can produce twice as many widgets or three times as many whatsits as Mr. A can.) Thus Mr. B has an absolute advantage in making both products, but Mr. A nevertheless still has a comparative advantage in widget making. This is because any actor's comparative advantage depends only upon the relationship between that single actor's own levels of productivity for two goods under consideration, while absolute advantage depends only upon the relationship between two actors' levels of productivity for the same single good under consideration.

The distinction between comparative and absolute advantage is important because it is comparative advantage (and not absolute advantage) that determines the amount of the potential gains in output from specialization and trade between the two actors. And this leads us to the Principle of Specialization According to Comparative Advantage:

Total production of goods will be increased if each economic actor devotes more of his scarce resources to producing the good(s) in which he has a comparative advantage and less of his scarce resources to producing the good(s) in which he has a comparative disadvantage.

In our example, if Mr. A works 180 hours a month producing only widgets (the area of his comparative advantage), he can produce 18 widgets. If Mr. B works 180 hours a month producing only whatsits, he can produce 18 whatsits.

If the two actors can agree to trade goods at any exchange ratio ("price") that is somewhere between the (different) opportunity cost ratios of the two actors [in our example, anything between two whatsits per widget and three whatsits per widget], then both actors will be able to have more of both goods ("be better off") with specialization than would be possible without specialization, even if one actor has an absolute advantage over the other in production of both goods. Mr. A will not voluntarily plan to trade away any of his widgets for less than 1/3 of a whatsit each because he can make the whatsits himself at that price, but he will come out ahead if Mr. B will give him more than 1/3 whatsit per widget. Mr. B will not voluntarily plan to trade away any of his whatsits at a price of more than 1/2 whatsit per widget because he can make widgets for himself at that price, but he will be ahead of the game if Mr. A will swap him at less than 1/2 whatsit per widget. Thus there is plenty of room for the two to bargain out a deal that is beneficial to both. (Through trade, each can have at least the same amount of widgets and whatsits that he would enjoy if each produced both products for his own consumption -- plus the added benefit of the hours saved via specialization, that can be enjoyed either directly in the form of extra leisure time or indirectly by using the hours saved to produce still more of these or other goods.)

However, if some kind of legal or illegal coercion (or perhaps extreme moral pressure from public opinion in a very traditional society) is exerted to fix an exchange ratio for the two goods that is not within the bargaining range between the opportunity cost ratios of the two actors, then either:

1. Trade will not take place at all between them (because one actor would be worse off than if he produced both goods for himself and hence will not voluntarily agree to specialize so as to trade on such terms)

2. An "exploitive" division of labor (such as slavery, serfdom, corvee, etc.) will somehow be imposed involuntarily so as to benefit one actor by assigning him all the gains from specialization and then some, at the expense of worsening the condition of the other "involuntarily specialized" actor.