The ponies’ knowledge of chemistry is roughly equivalent to our world’s was, about a hundred years ago–this in keeping with the trappings of steam locomotives and hydroelectric dams we see in the show.
They are aware of old style saltpeter-charcoal-sulfur gunpowder, and have been for centuries, but use it only for fireworks. Chemists there know about much more energetic substances but they are a curiosity and not even much experimented with.
It is because of old unicornish cultural attitudes toward such things. You can’t have effective long-range weaponry getting into the hooves of the rabble. One reason that unicorn warlords held as much power as long as they did was because magic gave them a monopoly on effective long-range attacks, and even now the Canterlot elite, almost all unicorns from the old aristocratic families, firmly believe that there are some fields of science and engineering best left unexplored. Anyone publishing research on, or trying to request the Equestrian military in, engineering applications for things like guncotton and TNT is going to be strongly discouraged, and might even disappear mysteriously some rainy night, all of his notes spontaneously combusting, doubtless from those dangerous chemicals he experimented with so irresponsibly.
The Griffins are equally conservative for the opposite reason. As obligate carnivores they are very proud of their physical abilities and are militarily wedded to an archaic “cold steel” mentality. These are cultural proclivities Celestia has spent centuries tacitly encouraging through means both overt and covert, because it makes them not even remotely a threat, nor even a speed bump, should it come to that (and every few centuries it does) to a Royal Guard that has alicorns to back it up.