Dynamite is one example of a chemical explosive. An explosive is anything that, once ignited, burns extremely rapidly and produces a large amount of hot gas in the process. The hot gas expands very rapidly and applies pressure. Other explosives that you commonly hear about are nitroglycerin and TNT, but anything from gasoline to ammonium nitrate fertilizer to special plastic explosives are in the same class.

Gasoline is what we are probably most familiar with, so let's start with it. Gasoline is made up of hydrogen and carbon atoms in chains. If you ignite a quantity of gasoline, it burns extremely rapidly -- oxygen in the air combines with the hydrogen and carbon atoms to create CO2 gas and H20 vapor (along with a lot of heat) in large quantities. The hot, expanding gas creates an expanding pressure wave that can blow things apart (or, in an engine, provide useful work).

Most true explosives contain the oxygen they need for burning in the chemical. This allows burning to occur much more quickly. Nitroglycerin, for example, has the chemical formula C3H5(ONO2)3. The carbon and hydrogen combine with oxygen, and the nitrogen is liberated.

Dynamite is simply some sort of absorbent material (like sawdust) soaked in nitroglycerin. The absorbent material makes the nitroglycerin much more stable. You normally use a blasting cap to detonate dynamite -- a blasting cap creates a small explosion that triggers the larger explosion in the dynamite itself.

Here are several interesting links:

Dynamite and TNT Tools, Products

Dynamite and TNT Use, Applications