Other attributes
In economic theory, comparative advantage refers to "an economy's ability to produce goods and services at a lower opportunity cost than that of trade partners." This concept is crucial for a comprehensive understanding of the economics of trade, as it explains that even a country (or person) that is superior to another in producing most if not all kinds of goods and services (i.e., one that has absolute advantage) can benefit from specializing and trading with the inferior country.
The reason this is possible is that all activities have some opportunity cost, meaning that one always has to give up the second best thing in order to do anything. The opportunity cost for waking up is the opportunity to get some more sleep; if I use three dollars on a cup of coffee, I can no longer use them to acquire anything else, etc. The same is the case with trade and specialization of labor.
To illustrate, one may note that though some country A is be able to produce both t-shirts and computers better than country B, it may be more efficient at making t-shirts than computers. Economist Donald J. Boudreaux contends that if these countries did not trade, "then the amounts that each can consume are strictly limited to the amounts that each can produce." If they rather decide to specialize and trade with one another, however, they'll both benefit as a larger quantity of both goods get produced. "Trade allows specialization based on comparative advantage and thus undoes this constraint, enabling each person to consume more than each person can produce."
To put it in mathematical terms, the theory of comparative advantage claims that
where X and Y denotes the quantity produced of the respective goods in countries A and B with (T - trade) and without (S - self-sufficiency) trade and specialization. It may be read as "the total quantity of goods X and Y produced in countries A and B is larger if they specialize in the production of the good they have a comparative advantage in and trade with one another than if they each were self-sufficient and produced both goods only for themselves."
As comparative advantage indicates that countries become more wealthy and prosperous as they specialize and trade more with one another, many economists favor free trade and denounce protectionist policies such as tariffs and quotas. While protectionism benefit those whose industries they protect from foreign competition, it is claimed to have a net negative effect on the economy at large. To explain such matters, the French economist Claude Frédéric Bastiat noted in 1850 that
"In the economy, an act, a habit, an institution, a law, gives birth not only to an effect, but to a series of effects. Of these effects, the first only is immediate; it manifests itself simultaneous with its cause – it is seen. The others unfold in succession – they are not seen: it is well for us if they are foreseen. [...] Now, this difference is enormous, for it almost always happens that when the immediate consequence is favorable, the ultimate consequences are fatal, and the converse."
Applying this principle to trade and protectionism, Economist Dan Mitchell contends that "It’s easy to identify jobs that have been 'saved' because of protectionism, but it’s not easy to calculate the greater number of jobs that are lost because of higher prices, lost purchasing power, enforced inefficiency, and lost competitiveness."