The Bible is inspired but it was also written by humans in a human way, which means many parts of it likely came out of oral tradition and such like you describe.
My personal suspicion (and not Christian doctrine by any means) is that the flood narrative in Genesis and the destruction of Sodom and Gomorrah refer to ancient cataclysmic events that can be understood through a naturalistic lens. Other things, like the crossing of the Red Sea and the sun standing still for Joshua and the Israelites are more likely miracles as we would commonly recognize them.
Either way, God is at work throughout.