The Hobbit has a narrator, who speaks from a "modern" perspective. It describes in the beginning how Hobbits are few now and avoid the tall folk, all that. So I'm fairly sure this is the narrator giving a frame of reference, rather than Bilbo knowing the smell.
Later it is also said that Orcs are cunning inventors of things that kill, including things that kill a lot of people at once.
Not only that, but in LoTR Helms Deeps outer wall is blown up with gun powder or similar.
I thought the Hobbit was meant to be written by Bilbo so a modern narrator explains it.
I knew there were things like explosives and fireworks, but unless guns are a common use, calling black powder "gunpowder" is weird so I wouldn't expect middle earth to have that word.
I thought the Hobbit was written by Bilbo as an account of his tales only to be translated at a later date by the narrator. Which explains why place names are in the original language but the rest of the book is in english.
Correct. To be more specific, in Tolkien lore, Bilbo (and later Frodo adding to it, organizing it, and editing it) wrote the “Red Book of Westmarch” which was later translated by the narrator of the books into the Hobbit and Lordnof the Rings. Many (most?) Tolkien fans prefer to frame things this way when discussing the stories, and for good reason— that’s how Tolkien himself viewed the stories. As a translation of something in another language. He was a linguist, after all.