Answer:
Environmental conditions, inner-social conditions, and trade conditions.
Explanation:
Environmental conditions-
A country cannot choose to be where the oil is at, or if rice can grow there, so they will specialize in what they can get to grow there, much like most Middle Eastern countries and oil.
Inner- Social conditions
The people in a country may not be happy with what the country is doing, causing certain things to be off limits to prevent a societal collapse (a tad dramatic, but you get the point). This bars certain economic prospects, causing specialization(ish).
Trade conditions-
Some things may just not need traded, there may be a bigger fish that can completely dwarf your trade, causing you to specialize into what you can easily trade.