Every country participates in the international trade to gain something and to make benefit from it. Exchange of goods takes place between the countries. One exports a good and other imports it. A country exports a good in which it specializes.
A country specializes in a product if it is able to produce the same good at a lower cost i.e, if it can produce more of a good using less of its resources in comparison to other countries. If it is so, then the country is said to have absolute advantage in that product and the country devotes all his resources on the production of those goods in which it specialize.
A country can even specialize in a product if it can produce it at a lower opportunity cost. Opportunity cost is the benefit forgotten by choosing any other alternative. If a country can produce at an opportunity cost less than any other country, the country is said to have a comparative advantage in that product and so it exports the product and other countries imports it.
So through specialization, every country can benefit from trade.