Have you ever noticed the strong similarity between many of the gods in the Ancient Near East? There's a reason for that. This is what Mark Smith calls the "translatability of the gods" in his book God in Translation: Deities in Cross-Cultural Discourse in the Biblical World.
The idea is simply this, as cultures collide, they share their beliefs. We find examples all throughout the ANE. In a poem describing Ramesses II's battle of Kadesh, we find the phrase, "I was like Seth in his time (of might)." We find the same poem at a different location with the name Montu, and we find a third copy with the name Ba'al. All three poems written about the same event, but they use two Egyptian gods and one West Semitic (Canaanite) god. What do they have in common? They are all three warrior-gods.
Here we have intercultural translations of deities. Since the deities are so close in ideal, it is very easy to say, "Oh, you worship the sun" Cool, so do we!"
Yeah, but how does this happen? It is really easy to explain. As groups interact with each other, they share stories of their gods. before too long, people start to put two and two together, and realize that the gods are very similar (even if they have major differences at first). One of the more famous of these "translations" is the translation of Ba'al in the Phoenician religion to Zeus in the Aegean religions. Since the Phoenicians were surrounded by mountains and the sea, they naturally became seafaring people, spreading their culture and religion across the entire Mediterranean (actually, material culture is found along the western coast of Africa and other places as well!).
So, bottom line - people share what they believe.
The Problem With the Way We Think
I think we too often see the ancient world as an idealistic society, not necessarily the ideals we would want but simply societies that exist outside of any influence—as if they are static, unchanging. Much like any society, though, there is a process of evolution taking place … cultures collide, share, borrow ideas.
Generally speaking, when two cultures collide, the lesser of the two accepts the culture of the greater. Sometimes not in its entirety, but at least to a very strong degree. Since stable, sedentary life is often considered greater than nomadism, the nomads will very often accept the sedentary culture and beliefs over their own, but only when that sedentary life is actually a better quality of life than what the nomads had. So, for example, when Semitic nomads moved from northern Arabia into Canaan at the end of the Neolithic period, the sedentary life was nothing to be envied … and so instead of the settling down and adopting the local life, the locals adopted the culture and beliefs of those coming into the land! On the converse, when Semites from northern Arabia traveled to Mesopotamia, they found a mighty culture, thriving in industry. These Semites adopted the culture and beliefs of the locals, settling into the new society. These Semites became known as the Akkadians.
The Same Gods?
Akkadian became known as a diplomatic language at this time, and some lists are found comparing the gods of different groups. As a part of the scribal curriculum, these deity lists were made, and this was later adopted in Ugarit as well. So, the Ugaritic Shapshu appears right next to the Sumerian dUTU—i.e., in the same slot. Why? Both are "sun gods." Of interest, here, is the fact that this is one of the very few instances when genders are crossed as Shapsu feminine but dUTU is masculine (Akkadian Shamash).
The Ugaritic goddesses called the Kotharatu (the "skillful females") coincide with the Akkadian Sassuratu, the womb goddess (as in, mother goddess). The Ugaritic goddesses are involved in conception portrayed in the story of Aqhat, and Sassuratu is involved in gestation, as in the story of Atrahasis. Close enough to be put in the same list.
Wibbly, wobbly, timey whimey sort of way
The lists go on and on with these same types of illustrations. When the two or three cultures collide, they share things, but over time—diachronically—ideas are changed and warped in a wibbly, wobbly, timey whimey sort of way (yes, I just went there). So Astar in northern Arabia is very close to Ishtar in Mesopotamia, but the problem is that Astar is masculine and Ishtar is feminine, so things warp. When Astar finally comes to Canaan from Mesopotamia, there are now two deities: Astar and Astarte, one masculine and one feminine—brother and sister. Over time, Astar falls by the wayside, and Astarte becomes more prominent, but is now considered an unmarried, maybe even androgynous, goddess.
Sometimes deities are not merged but simply adopted by other cultures. As the Greek world collided with the Near East on Cyprus, the gods and goddesses, again, began to warp. Before this time, Aphrodite was never a thought in Aegean religion, but when the Greeks saw Astarte combined with a local Cypriot goddess, they took her as their own, forming the goddess Aphrodite.
Of course, not everything translates. What one culture believed about their god or goddess may or may not be understood in another culture. So, although Astarte was considered unmarried, Aphrodite actually was given to Hephaestus to marry. This just goes to show that we cannot try to hammer down one belief and make it last throughout history… things are constantly evolving.
Another evolving area is in understanding Ba'al as Zeus. On the one hand, the myths are very similar: both storm gods, both take the throne of a father figure, both fight a great monster, both die when fighting that monster, and both come back again and win. On the other hand, the Greeks may have adopted some of the stories/myths, but they very much made them their own. Place names change, deity names change, and most importantly, they didn't change their own history and background when adopting these new myths. So, although Baal defeats El (El is the creator god and has no origin), Zeus defeats Kronos who had previously defeated his father … El might be similar to Kronos in that he was on the throne before the storm god took over, but that is about as far as the similarities are carried. The translatability of the gods was only taken to an extent and not beyond that extent. Our job, as exegetes of history, is to decipher when and where these beliefs were held.