Comparative advantage means that a country or region can produce a good or service at a lower opportunity cost than another country or region. Gains from trade mean that countries or regions that have a comparative advantage increase their overall welfare by exchanging goods or services with each other.
For example, country A can produce both wheat and wine, but it expends less resources to produce wheat. Country B can also produce both wheat and wine, but it takes less resources to produce wine. In this case, country A has a comparative advantage in wheat and country B in wine. If country A sells its wheat to country B and country B sells its wine to country A, both countries can obtain more goods or services. This is called the profit from trade.