The recipe for gunpowder was a state secret,
and trade in nitrous raw materials was restricted.
The Mongols conquered to obtain it.
Around 1376, the Korean Choe Mu-seon bribed a Chinese merchant to get the formula,
and figured how to extract potassium nitrate from soils.
See also in The book of science:
Readings on wikipedia: