Factor endowments impact a country's comparative advantage by affecting the opportunity cost of specializing in producing certain goods relative to others.
A comparative advantage exists when the opportunity cost of specialization is lower than that of other nations. The existence of a comparative advantage is, in turn, affected by the abundance, productivity and cost of labor, land and capital. Other factors also might influence a country's comparative advantage in practical terms, such as a highly developed financial system or economies of scale.
A simple example of a factor endowment with respect to land would be the presence of natural resources such as oil. Countries with abundant oil tend to export oil, focusing internal resources toward producing the factor they have in quantity. Angola is an extreme example of such specialization: oil accounts for 98% of its exports.
Labor is a key input in most products, from agriculture to cellphones, and its characteristics affect a country's comparative advantage. An abundant labor force means that a country has a lower opportunity cost of specializing in labor-intensive activities. A highly skilled labor force is more expensive and more productive than an unskilled labor force. For example, as China's labor force has grown more skilled, wages have risen and China has begun specializing in more complex manufactured goods.
Factor endowments are not static. With education, for example, the characteristics of the labor force can change. The same holds true for investments in capital and infrastructure. Over time, both can affect a country's sources of comparative advantage.