Some legends, such as the creation story or the flood, evolved from earlier sumerian versions. However, once in text form, they remained Hebrew stories. The only editing, redacting, and compilation after that time was done be Jews.
The following is an interesting website with a detailed description of the roots of much of the Hebrew scripture and Ugarit texts.
From:
Quartz Hill School of Theology
3. From the Literature of Ugarit to the Literature of the Bible.
The style of writing discovered at Ugarit is known as alphabetic cuneiform. This is a unique blending of an alphabetic script (like Hebrew) and cuneiform (like Akkadian); thus it is a unique blending of two styles of writing. Most likely it came into being as cuneiform was passing from the scene and alphabetic scripts were making their rise. Ugaritic is thus a bridge from one to the other and very important in itself for the development of both.
One of the most, if perhaps not the most, important aspect of Ugaritic studies is the assistance it gives in correctly translating difficult Hebrew words and passages in the Old Testament. As a language develops the meaning of words changes or their meaning is lost altogether. This is also true of the Biblical text. But after the discovery of the Ugaritic texts we gained new information concerning the meaning of archaic words in the Hebrew text.
One example of this is found in Proverbs 26:23. In the Hebrew text כֶּ֣סֶף סִ֭יגִים "silver lips" is divided just as it is here. This has caused commentators quite a bit of confusion over the centuries, for what does "silver lips" mean? The discovery of the Ugaritic texts has helped us to understand that the word was divided incorrectly by the Hebrew scribe (who was as unfamiliar as we are with what the words were supposed to mean). Instead of the two words above, the Ugaritic texts lead us to divide the two words as כספסיגים which means "like silver". This makes eminently more sense in context than the word mistakenly divided by the Hebrew scribe who was unfamiliar with the second word; so he divided into two words which he did know even though it made no sense.
Another example occurs in Ps 89:20. Here the word עָזַר is usually translated "help" but the Ugaritic word
gzr means "young man" and if Psalm 89:20 is translated this way it is clearly more meaningful.
Besides single words being illuminated by the Ugaritic texts, entire ideas or complexes of ideas have parallels in the literature. For example, in Proverbs 9:1-18 wisdom and folly are personified as women. This means that when the Hebrew wisdom teacher instructed his students on these matters, he was drawing on material that was commonly known in the Canaanite environment (for Ugarit was Canaanite). In point of fact, KTU 1,7 VI 2-45 is nearly identical to Proverbs 9:1ff. (The abbreviation KTU stands for
Keilalphabetische Texte aus Ugarit , the standard collection of this material. The numbers are what we might call the chapter and verse). KTU 1.114:2-4 says:
hklh. sh. lqs. ilm. tlhmn
ilm w tstn. tstnyn d sb
trt. d. skr. y .db .yrh
Eat, o Gods, and drink,
drink wine till you are sated,
Which is very similar to Proverbs 9:5;
Come, eat of my food and drink wine that I have mixed .
Ugaritic poetry is very similar to Biblical poetry and is therefore very useful in interpreting difficult poetic texts. In fact, Ugaritic literature (besides lists and the like) is composed completely in poetic metre. Biblical poetry follows Ugaritc poetry in form and function. There is parallelism, qinah metre, bi and tri colas, and all of the poetic tools found in the Bible are found at Ugarit. In short the Ugaritic materials have a great deal to contribute to our understanding of the Biblical materials; especially since they predate any of the Biblical texts.
4. The Ugaritic Pantheon.
The prophets of the Old Testament rail against Baal, Asherah and various other gods on nearly every page. The reason for this is simple to understand; the people of Israel worshipped these gods along with, and sometimes instead of, Yahweh, the God of Israel. This Biblical denunciation of these Canaanite gods received a fresh face when the Ugaritic texts were discovered, for at Ugarit these were the very gods that were worshipped.
El was the chief god at Ugarit. Yet El is also the name of God used in many of the Psalms for Yahweh; or at least that has been the presupposition among pious Christians. Yet when one reads these Psalms and the Ugaritic texts one sees that the very attributes for which Yahweh is acclaimed are the same for which El is acclaimed. In fact, these Psalms were most likely originally Ugaritic or Canaanite hymns to El which were simply adopted by Israel, much like the American National Anthem was set to a beer hall tune by Francis Scott Key. El is called the father of men, creator, and creator of the creation. These attributes are also granted Yahweh by the Old Testament.
For instances, read KTU 1. 2 I 13-32 and compare it to many of the Psalms. Also, read Ps 82:1, 89:6-8!).
In 1 Kings 22:19-22 we read of Yahweh meeting with his heavenly council. This is the very description of heaven which one finds in the Ugaritic texts. For in those texts the sons of god are the sons of El.
Other deities worshipped at Ugarit were El Shaddai, El Elyon, and El Berith. All of these names are applied to Yahweh by the writers of the Old Testament. What this means is that the Hebrew theologians adopted the titles of the Canaanite gods and attributed them to Yahweh in an effort to eliminate them. If Yahweh is all of these there is no need for the Canaanite gods to exist! This process is known as assimilation.
Besides the chief god at Ugarit there were also lesser gods, demons, and goddesses. The most important of these lesser gods were Baal (familiar to all readers of the Bible), Asherah (also familiar to readers of the Bible), Yam (the god of the sea) and Mot (the god of death). What is of great interest here is that Yam is the Hebrew word for sea and Mot is the Hebrew word for death! Is this because the Hebrews also adopted these Canaanite ideas as well? Most likely they did.
One of the most interesting of these lesser deities, Asherah, plays a very important role in the Old Testament. There she is called the wife of Baal; but she is also known as the consort of Yahweh! That is, among some Yahwists, Ahserah is Yahweh s female counterpart! Inscriptions found at Kuntillet Ajrud (dated between 850 and 750 BCE) say:
I bless you through Yahweh of Samaria,
and through his Asherah!
And at El Qom (from the same period) this inscription:
Uriyahu, the king, has written this.
Blessed be Uriyahu through Yahweh,
and his enemies have been conquered
through Yahweh's Asherah.
That Yahwists worshipped Asherah until the 3rd century before Christ is well known from the Elephantine Papyri. Thus, for many in ancient Israel, Yahweh, like Baal, had a consort. Although condemned by the prophets, this aspect of the popular religion of Israel was difficult to overcome and indeed among many was never overcome.
As had already been mentioned, one of the more important lesser deities at Ugarit was Baal. Baal is described as the rider on the clouds in KTU 1.3 II 40. Interestingly enough, this description is also used of Yahweh in Psalm 68:5.
In the Old Testament Baal is named 58 times in the singular and 18 times in the plural. The prophets protested constantly against the love affair the Israelites had with Baal (cf. Hosea 2:19, for example). The reason Israel was so attracted to Baal was that, first of all, some Israelites viewed Yahweh as a God of the desert and so when they arrived in Canaan they thought it only proper to adopt Baal, the god of fertility. As the old saying goes, whose land, his god. For these Israelites Yahweh was useful in the desert but not much help in the land.
There is one Ugaritic text which seems to indicate that among the inhabitants of Ugarit, Yahweh was viewed as another son of El. KTU 1.1 IV 14 says:
sm . bny . yw . ilt
The name of the son of god, Yahweh.
This text seems to show that Yahweh was known at Ugarit, though not as the Lord but as one of the many sons of El.
Among the other gods worshipped at Ugarit there are Dagon, Tirosch, Horon, Nahar, Resheph, Kotar Hosis, Shachar (who is the equivalent of Satan), and Shalem. The folks at Ugarit were also plagued by a host of demons and lesser gods. The people at Ugarit saw the desert as the place which was most inhabited by demons (and they were like the Israelites in this belief). KTU 1.102:15-28 is a list of these demons.
One of the most famous of the lesser deities at Ugarit was a chap named Dan il. There is little doubt that this figure corresponds to the Biblical Daniel; while predating him by several centuries. This has led many Old Testament scholars to suppose that the Canonical prophet was modeled on him. His story is found in KTU 1.17 - 1.19.
Another creature which has ties to the Old Testament is Leviathan. Isaiah 27:1 and KTU 1.5 I 1-2 describe this beast. Also see Ps 74:13-14 and 104:26.
There is more that I may post that well documents the origin of the Hebrew scripture, language and culture and the intimate relationship and origins of Judaism with Ugarit culture and language.