Gunpowder developed as a weapon in China about 1000 CE (common era, formerly designated AD) although it has been used for pyrotechnics as far back as 100 BCE (before the common era, formerly BC).
Weapons use probably started with fire arrows, small tubes of bamboo attached to arrows that fizzed smoke and fire. A logical next step was bombs, essentially large firecrackers.
The next development in gunpowder weaponry may have been fire lances, larger tubes of burning gunpowder that spew fire and sparks at enemy combatants.
With better quality and purity, gunpowder grew more explosive, resulting in the easy step of adding shrapnel to the fire lance. Soon, the bamboo tubes would be replaced with metal ones.
By the end of the thirteenth century, an enclosed projectile could be thrown by the exploding gasses confined in a tube. The gun was born. No longer was the smoke and fire the resulting weapon. The projectile was the payload.
This technology had reached Europe by the thirteenth century. Its use only limited by the quality of ingredients and by metallurgical constraints of the gun barrel.
Gunpowder is comprised of only three ingredients: potassium nitrate (saltpeter), charcoal and sulfur in a ratio of 75%, 15% and 10%.
Sulfur ignites at a low temperature (261 degrees) starting the explosive process. This starts the charcoal burning and breaks down the saltpeter which, consisting of Potassium and Oxygen, releases pure oxygen. This then accelerates the burning/exploding of the charcoal. The heat of this reaction produces massively expanding black gases. If constrained, this becomes an explosion.
The charcoal is easily made from wood: just burn with insufficient air. The physical structure of the wood is important for the charcoal to easily pulverized as well as to have a low ash content. Willow is a common source (and is used as a traditional artists’ medium) as well as alder, hazel wood or grape vines.
Sulfur was more difficult to find. It’s an element, so it’s either geologically available or not. Prior to refining sulfur from petroleum products or natural gas, it had to be found as a solid in the ground near hot springs and volcanic regions.
Sicily was an important source in the medieval world. Its purity was variable, but it could be easily purified. One method was to heat impure sulfur in a clay pot, the vapors given off were directed by a clay pipe to another pot where the fumes condensed into pure sulfur.
Saltpeter was even more difficult. Its chemical name is potassium nitrate, having a potassium ion attached to a nitrate ion. The nitrate ion consists of three oxygen atoms bonded to one nitrogen. Saltpeter is very soluble and is released from organic matter. One common source was privies and compost heaps from which, if protected from the weather, small amounts of saltpeter leached to the surface. The resulting white crust was saltpeter.
Once the ingredients were obtained, the next step was mixing them into the actual gunpowder. First the ingredients were mixed by mechanical or hand blending.
Next the mixture is ground into a microscopically fine homogeneous powder. Considerable heat can be produced, so this material was always kept moist.
In the third step, the material is pressed into cakes, producing a denser compound.
Finally, the cakes are granulated between crusher rolls. Screens are used to separate the grains. The end product is uniform mixture of black powder in the appropriate grain size. This last is important in that the size of the particles determine the rate of burning. For example, in larger cannon, larger grained gunpowder was used while rifled guns used finer grained powder.
Making gunpowder was a highly technical development. The chemistry wasn’t understood until the 19th century when it was discovered that the nitrate provided oxygen for the reaction.
The critical development in the use of gunpowder was metallurgical, the development of iron of sufficient quality to contain the exploding powder long enough to allow a projectile to be accelerated out of a gun or cannon.