I would imagine if nothing else, gunpowder.
Bombs are older than guns.
Though in Zelda bombs are a plant. They just grow like that. There are also enemies that are bombs, and magic exists to create bombs. All of which have been used as canon explanations for the bombs in the games.
Just to expand on this: in the Zelda series it differs from game to game. In some games they are bomb flowers (e.g. Tears of the Kingdom, also Wind Waker if I remember correctly), in other games they appear to be man-made and are bought in shops (e.g. Ocarina of Time, Twilight Princess, I think?) and are presumably conventional bombs with gunpowder as you mentioned. I don’t remember any game where bombs are an enemy like you said, but I’ll take your word for it. I haven’t played every game.
I don’t remember any game where bombs are an enemy
OoT also has the bomb flowers. You have to blow up the large boulder blocking Dodongo’s cavern by throwing a bomb flower from the cliff and then in the cavern you get the bomb bag to start carrying bombs.
I’m also pretty sure that somewhere in OoT someone says that bomb flowers are the raw material for bombs
If you mean the classic black ball with a wick, they were pretty much hollow cannonballs filled with gunpowder and a wick. You’d light the wick, run, and the gunpowder would explode, flinging shards of cannonball everywhere.
What is cannonball made of tho?
Iron
Originally, they would have been gourds or clay pots.
Cannon
What bombs in Pokémon? Geodude and a few others have Self Destruct, but I do not recall bombs.