People create gods and myths based on their experiences. Throughout human history (and pre-history, but I'm just going to use the catch-all term "history"), many of those experiences were very similar through out the world. Floods, for example, have been a common occurrence in history. Given the close attachment humans have had with river valleys, and coastal areas, it is incredibly likely that most civilizations have experienced catastrophic floods sometime in their existence. Those events will get passed on via verbal and eventually written transmission, likely growing and gaining supernatural attribution along the way. What might have been a localized catastrophe eventually gets spun into the gods seeking to wipe out all humanity.
Other myths follow similar trajectories, humans have experiences and build stories around them. Lightning was an incredible, often destructive force to ancient humans, which defied explanation. So humans built stories around it and we got various deities causing or wielding lightning. Of course, unconnected communities of humans would have come up with different stories, but all of them are starting from the same question, "what is lightning?". So, it's not surprising that their myths have similar themes even before we start considering the cross-pollination of myths between different areas of the world as trade networks grew.
And it's important to remember that the ancient world was connected by trade and war. Cultures interacted and subsumed one another over the course of millennia. And much of that occurred among per-literate societies. While they may have had a strong emphasis on oral traditions, mistakes and intentional changes have a way of creeping into stories over time. A thousand year long game of telephone is going to changes things. Re-tellings of stories may have picked up something from a nearby tribe, or as one tribe was militarily dominated by another, details may have shifted to deal with that domination. Traders bringing back stories from far flung lands may have been misremembered but still incorporated into the local myths.
As an example of this, look at the Isis cults of the Roman Empire. Romans got fascinated with the Egyptian deity and founded temples to her in places as far away from Egypt as Germany. With the Isis of the Roman cults being quite divergent from the Isis of earlier Egyptian myths. Were those cults still active today, they might have picked up Jewish or Christian influences as the Roman Empire adopted Christian mythology.
In short, humans are the same all over and have been having similar experiences everywhere. Some places have special circumstances and their myths may account for these things, but the broad strokes are going to cover a lot of the same terrain. Questions like "why are we here", "what happens when we die", "why did the river just eat everything" and "WTF was that bright flash and loud boom". The stories for these things are going to end up in the same ballpark. And once you account for information moving about, it would be strange if they didn't seem similar.