What causes a country to specialize in certain products?

Athe interest of the citizens.
Bthe resources of the nation.
Cthe ability to trade with other nations.
Dthe money it can earn from producing particular products.