The ancient scribes of the bible were inspired by their belief in their god(YHWH), which gave them motivation to tell stories
of their god to create a semblance of reverence and power. They knew of other civilizations that worshiped other god(s)
which also gave them motivation to create a connecting relationship with their own chosen god.
These stories created a emotional connection with these people very similar in the way that they do today.
What use is a god if you don't tell stories about him and what he would do for you ?