It seems obvious that the OT is made up of tales, legends, and historical records of mostly the people of Judah. The source of the stories is not relevant. What is important/relevant is what the stories present or convey.
According to the Assyriologist Jean Bottero, the Near East ancients were very clever, intelligent but were not able to think abstractly. To me that would explain the need for stories, for concrete examples.
Bottero also mentions how ancient NE man thought that there were many gods living in a society similar to man's; that man was a plaything of the gods that had to be constantly propitiated; that whatever evil came, came from the gods as a whim or because of failure to please with the right sacrifices. When you read the OT, you can see how this view is being shoehorned into a monotheistic view hence you read about God sending evil. Once the Judeans are exposed to Zoroastrianism during the Babylonian captivity, then evil has a difference source modeled on the antagonist of AhuraMazda.
