There are at least two major reasons for countries to engage in international trade.
First, a country may be able to benefit from buying products from a foreign country. The product may not be available in their own country or the other country may have a comparative advantage in producing it. Either way, importing these products benefits a country.
Second, a country may be able to benefit from exporting goods. A country may have products that another country needs or it may have a comparative advantage in making certain products. In such cases, the country will profit by selling its goods to other countries.
In both cases, the country is engaging in international trade because it can benefit from this trade economically.
The major reason for countries to participate in international trade is to sell their surplus produce and to cover their deficits in production. Basically, the products sold by a country to another are referred to as exports while products bought from another country are known as imports. For example, country A has a vegetable shortage and to cover this shortage they bring in the product from their neighbor country B. On the other hand, country A has surplus of sugar which they sell to country B which has a deficit of the same. In this instance, country A will be importing the vegetables from country B and at the same time country A will be exporting sugar to country B. The two countries A and B are thus participating in international trade. International trade facilitates access to new markets for the different countries in the world. These new markets form the basis for interactions and exchange towards the mutual benefit of countries participating in trade.
The primary reason for engaging in international trade is the unequal distribution of resources among nations. Resources are concentrated in some nations and other nations have no option but to trade them (unless a cheaper or better local alternative is found). In general, a nation satisfies the demands for a scarce resource by trading with a more abundant local resource. An example is Japan, which has no oil reserves, but is still one of biggest consumers of oil (by importing it from oil-rich countries).
International trade offers some advantages to a nation. By exploiting its comparative advantage, a nation can specialize in producing certain good and services more efficiently and at low opportunity cost and this allows an economics of scale (large-scale production). International trade also breaks down domestic monopolies and keeps the prices in check (due to competition). It also results in better product quality and generates employment.