You are describing the difference between rapid deflagration and detonation. The two are closely related and one can lead to the other under the right circumstances. It is a difference between a substance that burns very rapidly, and another that when insulted with a shock wave, triggers a rapid chemical reaction that releases massive amounts of energy as the shockwave passes through it.
The explosions in China several months ago are reported to have been in a massive warehouse full of ammonium nitrate. A small fire inside led to progressively larger detonations of more and more AnNi as each detonation released more and more heat into the surrounding bags until enough of it was heated to the spontaneous detonation point.
The problem with all of this is many things can be assembled correctly to produce an explosion powerful enough to remove a limb. Black powder from fireworks, if confined properly and in sufficient amounts could work well. Given the proximity to the 4th of July I would suspect that was probably the explosive de jour, the trigger could be made any number of ways by some clever boy...
Picric acid is a good example. As long as it is wet it is relatively stable, but dry it out and it is impact sensitive and will detonate.
The China thing involved one heck of a lot flash powder!
Imagine what it would been like with the same amount of dynamite. 8)
What ever was hidden under a rock that the guy stepped on was certainly some form of High explosive.
(An instant detonation)
No way could you get your foot/leg blown off with the small amount of black powder that could be hidden under a rock.
High explosives, like TNT, have a different combustion propagation mechanism. Typically the initial combustion of a small amount of explosive (or of a primer cap) generates a shock wave that compresses and heats the remainder of the explosive charge. At a critical temperature and pressure all of the remaining explosive combusts at essentially the same time.
The explosive speeds are ten times (or more) faster than in the fastest deflagration reactions.
The amount of energy released by the two types of explosive are roughly the same, the difference is in how fast the energy is released.
Gun powders, for everything from pistols to 16" naval guns, always burn by deflagration and not detonation.
If you put a detonation (high) explosive in a gun cartridge chances are the gun will explode.
Salutes are almost always flash powder, since flash powder burns faster and gives a better flash and bang than black powder or smokeless powder.
In fireworks, black powder is mostly limited to propellant for professional aerial mortars.