Suppose we have an economy with only two people and two commodities. Maybe they're living on an otherwise deserted island somewhere, and they can spend their time either picking bananas or catching fish.
The first person, let's call her Jane, can pick 100 bananas if she spends 100% of her week picking bananas, or she can catch 50 fish if she spends 100% of her week fishing. She can also choose to spend part of her time catching fish and part of her time picking bananas. If we graph all the possible combinations of bananas and fish she could get, we get her feasible set.
The second person on the island, let's call him Gilberto-Rahoule, has different skills from Jane. He can pick 50 bananas if he spends 100% of his week picking bananas, or he can catch 100 fish if he spends 100% of his week catching fish.
Since Jane is better at picking bananas and Gilberto-Rahoule is better at catching fish, they can each be better off if they specialize in what they're good at, and trade for what they're not. For example, if Jane picks 100 bananas and Gilberto-Rahoule catches 100 fish, and they trade 50 bananas for 50 fish, they'll each have more than they could have got alone. 50 bananas and 50 fish is outside both individuals' feasible sets, and yet they can achieve it through trade.
Let's say Jane hurts her leg, and has to spend half her time resting it. Now her feasible set has shrunk, so she can pick at most 50 bananas and catch at most 25 fish. Now Jane isn't any better than Gilberto-Rahoule at picking bananas. Can Jane and Gilberto-Rahoule still have gains from trade? Yes, they can.
What matters is not whether either of them has an absolute advantage in fishing or banana picking, but whether they have a relative advantage. Jane would still have to sacrifice 2 bananas to catch one fish herself, and Gilberto-Rahoule would still have to sacrifice 2 fish to pick one banana himself, so trading one banana for one fish is still beneficial to both.
In this simple economy, trade allowed each person to consume a little more than they could have alone. In a bigger economy with more people and more commodities to trade, the benefits are many hundreds of times larger.