The concepts of Comparative advantage, Absolute advantage and gains from trade should be outlined before we go over an example.
Absolute advantage is the simplest concept. It is just comparing two countries to see who is more efficient (how many units they can produce within a specified time frame) at producing a good.
A country can have an absolute advantage in producing both goods.
Comparative advantage is comparing two countries to see who has the lowest opportunity cost of production. That is, who gives up the least of one good to produce the other.
A country can only have a comparative advantage in producing one good, not both goods.
Gains from trade is just the notion that both countries can be made better off if they trade with each other. We measure "better off" as having more goods overall.
England and Scotland both produce scones and sweaters. Suppose that an English worker can produce 50 scones per hour or 1 sweater per hour. Suppose that a Scottish worker can produce 40 scones per hour or 2 sweaters per hour.
Using the above example let's apply the outlined concepts for a practical example.
Which country has absolute advantage?
Because English workers can produce 50 scones per hour which is 10 more than Scottish workers who can produce 40 scones an hour, they have an absolute advantage in producing scones.
Because Scottish workers can produce 2 sweaters compared with English workers who can only produce 1, they have an absolute advantage.
Which country has a comparative advantage?
This we have to see what the opportunity cost of producing a good. The opportunity cost of an English worker producing a sweater is 50 scones. This is because if they spend an hour producing a sweater, they could have been producing 50 scones.
The opportunity cost of a Scottish worker producing a sweater is 20 scones. This is because in an hour they can produce 2 sweaters or 40 scones. Therefore, for each sweater they lose 20 scones.
This means that Scottish workers have a comparative advantage in Sweaters and English workers have a comparative advantage in Scones.
Gains from trade
To show gains from trade we need to show that each country specializing can increase overall output. Now, countries should produce the good where they have the comparative advantage.
Scottish workers should be producing Sweaters. Let's suppose they reduce their scone production by one hour and use that hour on sweater production. Overall, we will have 2 more sweaters but 40 less scones.
Now, let's suppose that England spends one less hour on sweater production and 1 extra hour on scone production. This reduces sweater output by 1 unit, however, scone production increases 50 units.
Overall, There is now 1 extra sweater and 10 scones in the economy. If England and Scotland can share those goods between them there will be gains from trade.