Why do countries trade, and why does trade benefit even a country that is worse at producing everything? David Ricardo's answer, comparative advantage, is two centuries old and still the foundation of trade theory. His model has one input, labor.
We will compute autarky prices, find comparative advantage, decide specialization at the world price, measure the gains from trade, and finish with wages.
Step 1: Autarky prices
Countries differ in unit labor requirements: aC hours per unit of cloth, aW hours per unit of wine. Without trade, the relative price of cloth equals its relative labor cost, because both industries must pay the same wage:
This is the opportunity cost of cloth: the wine given up to make one more unit. Home needs 2 hours per unit of cloth and 4 per unit of wine, so cloth costs 0.5 wine there.
Step 2: Comparative advantage
A country has the comparative advantage in the good it gives up less to make: the good with the lower autarky price. Foreign needs 6 hours per unit of cloth and 5 per unit of wine, so cloth costs 1.2 wine there, against Home's 0.5. Foreign is worse at both goods, yet Home has the comparative advantage in cloth and Foreign in wine: needing fewer hours, absolute advantage, doesn't decide trade.
Step 3: Specialization at the world price
With trade, a world relative price p of cloth emerges, between the two autarky prices. If p is above Home's autarky price, cloth is worth more abroad than it costs at home, so Home specializes in cloth and imports wine; if p is below, Home specializes in wine; at exactly the autarky price, Home is indifferent. Example: at p = 1, between Home's 0.5 and Foreign's 1.2, Home makes cloth, earning 1 wine for each unit that cost it 0.5, and Foreign makes wine.
Step 4: Gains from trade
If Home exports cloth at world price p, an hour spent on cloth makes 1/aC cloth, which trades for p/aC wine, more than the 1/aW wine it would make directly. Trade is an indirect, more efficient way of producing imports. Example: at p = 1, an hour of Home labor makes ½ cloth, which buys ½ wine: twice the ¼ wine the hour makes directly. Below, Home has 100 hours of labor, so it can make 50 cloth or 25 wine; vary the world price to see its consumption possibilities.
Home has 100 hours; cloth takes 2 hours and wine 4, so its autarky price of cloth is 0.5 wine. At p = 0.8, Home makes 50 cloth and trades along the solid line, reaching up to 40 wine instead of 25. Wherever the trading line lies outside the PPF, trade lets Home consume more of both goods.
Step 5: Wages and productivity
With Home specialized in cloth and Foreign in wine, each country's wage equals the value of what a worker makes per hour: w = PC/aC and w* = PW/a*W. So relative wages reflect relative productivity and world prices. Example: with both goods priced at $1, Home's wage is 1/2 = $0.50 an hour and Foreign's 1/5 = $0.20. Foreign exports wine though it is less productive in everything: its lower wage offsets its lower productivity. This refutes the "pauper labor" argument that trade with low-wage countries must hurt rich ones. A key limitation: with one factor, nobody inside a country loses from trade.