Ancient historians invented speeches and put them on the lips of famous figures because they thought the speeches would be like what the famous people would have said. Similarly, the Greeks invented the story of Helios dragging the sun across the sky because to them that sounded reasonable and made sense of the phenomenon. Similarly, Jewish thinkers invented stories to explain the world, like understanding the cosmos and the firmament. Here was what they came up with:
The bible is a compilation of sources from over a long period of time by many ancient superstitious and uninformed (compared to moderns) authors who often had different purposes and theologies. It is not odd, then, that we find contradictions in their works, such as whether lying is allowed: see https://skepticsannotatedbible.com/contra/lie.html . It’s hard to reconcile Jesus’ message of love of enemy and asking God to forgive them with horrific images in Revelation such as the winepress.
Religion currently serves a rather peculiar function in society. Take the practice of prayer. On the one hand, we understand that prayer doesn’t work:
Let us consider an example of this: The Trolley Problem
The tram is coming down the track. If you do nothing, 4 people will die, but if you switch the tram to the other track, you will save them and kill the person on the other track. What would you do? No one thinks “praying for a miracle” is an honest or reasonable solution to the trolley problem, because inside of us, hidden more deeply in some than others, we understand praying for a miracle isn’t going to work (eg. Praying for the tram to magically stop or disappear).
So, if we understand that prayer doesn’t work as part of the background information of how we approach the world, why are, as they say, no atheists in foxholes?
This idea of the sudden reasonableness of God in the face of desperation can be seen in society too, such as with Alcoholics Anonymous where the most basic principle is the sufferer has to admit they are powerless against alcohol and only God can transform their soul against it: