Its been a long time since i read the books so im not sure if this is present in the books, but there is gunpowder in the movies because the orcs use a bomb at one point.
The books are ambiguous. There's an explosion caused by a device made by Saruman, but it isn't described and there's no indication AFAIK if it's supposed to be simple black powder or something magical.