The origin of the Hebrews and their interpretation of God as Yahweh is a real mystery.
Just on the surface, if their patriarch is Abram, that makes them Iraqi descendants, in today's terms. And if they spent 400 years in Egypt, there had to be some intermarriage there. Then they move into Canaan and intermarry there, too. So who are they? or who do they become?
And, if one believes the story, God lets them be slaves for 400 years, before he even gives them his name in the Sinai.
At a minimum there's a real "nation building" feel to the OT. Everyone follows the same rules, God travels with the people wherever they go, and time and again it's nations that are judged and punished, more so than individuals in many cases.