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 because the mixture is not stable in damp environments. Dynamite that is damp, or even wet slowly loses its nitroglycerin. The nitroglycerin can build up, and explode unexpectedly.
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. However, dynamite still used in movies and television.