This is something I've been in mind to post here for awhile. ...But time flies.

So what is it? Well, from left to right. the top: TNP and HMX.
Bottom: TNT, RDX and PETN.
And these happen to be the major main ingredients in most of the "modern military explosives", which have made the world a worse place since WW1.
TNP (TriNitroPhenol) was first out, and was the major ingredient in Lyddite and Shellite, two British WW1 explosives. Lyddite was TNP melted together with petroleum jelly and was cast into artillery shells. Because the Lyddite shells were insensitive enough to be fired from guns, but tended to explode on hard impact, regardless of the fuse, the Navy needed something even more insensitive for their armor piercing shells. That was Shellite, which added some DiNitroPhenol, TriNitroBenzene alternatively Hexanitrodiphenylamine to the TNP mix. TNP went out of use because of it's precarious shelf life. It's an acid which slowly attacks the metals in the shell.
TNT (TriNitroToulene) was started to be used by the Germans, also during WW1. TNT has many extremely good properties. It's very insensitive. What's more, it transfers that insensitivity to most mixes with other ingredients. It also transfers a low critical diameter. So despite not being a strong explosive in itself, it has been very popular as ingredient in many explosives. In its almost pure forms (though it typically also contains DNT) it's known as Trotyl or Tritol.
Explosives containing some TNT, as an ingredient, is almost the entire list of explosives used during WW2 and after, through Vietnam war: Amatol, Ammonal, Tritonal, Torpex, Cyclotol, Hexotol, 'B' (i.e. B2, B3 etc), Octol, H6, Hexolite, DBX, HBX, Baratol, Pentolite.
In more recent years, use of TNT has been in sharp decline with US & Britain.
RDX is the main player today. It's also an ingredient in many of the WW2 explosives above. But of more modern interest is to use it without mixing it with TNT. The reasons are both environmental and the fact that a TNT+RDX mix doesn't sit well in a fire. So in order to make RDX insensitive enough, a number of other tricks have come into use instead. Combining it with waxes, oils and polymers.
A famous plastic explosive, using RDX as the main ingredient, is 'C', like C4, the latest version. Most PBX explosives (polymer bonded) are also based on RDX. 'A', like A5, as used in landmines and rockets, is also an RDX explosive. ("A" is a standardized pellet explosive intended for press-filling charges. "B" is a standardized explosive for melt-casting into shells. "C" is a standardized, putty like plastic explosive.)
HMX is a very powerful explosive substance. It's also more expensive and more difficult to combine to successful mixes. The most wellknown HMX-explosive is probably Octol, where it's mixed with TNT. A few PBX-explosives are also HMX based.
PETN is used in many parts of the world as an alternative to RDX. They have similar properties. The funny thing about PETN is that in pure form, it's very sensitive, ready to explode anytime. So in the last manufacturing step, the crystals are treated with a type of wax. This wax treated PETN is then almost as insensitive as TNT. An infamous plastic explosive using PETN as the main ingredient, is the Czech plastic explosive called Semtex. PETN and TNT mix is called Pentolite. PETN also have some civilian use as in products like Detasheet and Detacord.
Otherwise, civilian explosives have to be much cheaper, less toxic, more environmental friendly, but don't need as long shelf life or to be as extremely insensitive. So Dynamites, ANFOs and GSXes are based on other ingredients, AN (Ammonium Nitrate), Methylammonium Nitrate, Nitroglycerin, Nitroglycol, Nitrocellulose, DNT, Sodium Nitrate.