We hear sounds when air molecules push on our eardrums. The harder they push, the louder the sound.
To create sounds, we push on the air. The faster we push on the air, the more pressure we create, since the air has less time to get out of the way.
If you push on the air with your hand, you can feel the pressure of the air on your face, but you won’t hear any sound because your hand is moving too slowly. To make a sound, you have to move the air faster than it can get away. We do this by clapping our hands together. That traps air between our hands, increasing the pressure. The air molecules can’t get away fast enough, so they get all crowded together.
When an explosive is set off, it produces a lot of molecules of gas in a very short time. These molecules bounce into air molecules, and make sound waves. The faster the explosive burns, the louder the sound waves will be.
A firecracker moves air faster than your clapping hands can move air, so it sounds louder than hand clapping. Dynamite explodes faster than gunpowder, so it makes an even louder sound.