Is is considered truth amongst laymans like myself that gunpowder was first created in China, with a mix of salitre, coal and sulphur, however what were they trying to create/investigate and what led them to actually create gunpowder? This doubt has been bugging me for a while, as the only answer I came up with is that they were trying to create some kind of festival item, such as a sort of firework or some thing.
Potassium nitrate and sodium nitrate are both found in the earth of livestock barns, or in the dirt under outhouses- anywhere urine can concentrate and degrades. Both are both good oxidizers. If you soak a piece of paper in one of them and let it dry, it will burn rapidly. Charcoal soaked in this solution will burn rapidly, also. So, knowing this, anyone tinkering with other ingredients ( especially knowing that sulphur burns) might have just been experimentally mixing in other things to see what would happen, and gotten something like fireworks. Or , something like a magic cotton robe that disappears in flames in a moment.
There were later processes that had to be worked out to make something that worked well in cannon and handguns: to eliminate sodium and calcium nitrates they learned to mix the leached saltpeter with wood ash. The closer the contact of the nitrate with the charcoal the better, so certain kinds of wood were found to be better- the charcoal from them could be more easily ground finer. And of course the ideal ratios- how much saltpeter to sulfur, etc, also were slowly worked out. This development took much of the 13th-14th centuries in Europe.
Bert S Hall : Weapons and Warfare