Dynamite is an explosive invented by Alfred Nobel. Its main explosive component is nitroglycerin. Nitroglycerin is very sensitive to movement. It explodes very easily, when moved. For this reason, diatomaceous earth is used to take away this sensitivity. In dynamite, about one part of four is diatomaceous earth, the other three are nitroglycerin. A little sodium carbonate is added to stabilise the mixture.
Even though the diatomaceous earth takes away some of the dangers of nitrogycerin, there are still problems that the mixture is not stable in damp environments. Dynamite that is damp, or even wet slowly loses its nitroglycerin. The nitroglycerin can accumulate in the envirnoment, and explode unexpectedly.
For this reason, the formulation was changed. Instead of diatomaceous earth, gelignite was used to bind the nitroglycerin. Gelignite binds the nitroglycerin so that it is no longer able to dissolve in water.
Today, dynamite is no longer used commercially. It has been replaced by explosives based on ammonium nitrate which use gelignite. These explosives are cheaper to produce, and easier to handle than dynamite.
Although dynamite is no longer used in work use it is also still used in flims and television.