The Bible is not literally true, and was probably never intended to be read that way.
We have known for 200 years that Genesis is not literally true - simple geology that was visible to everyone made it obvious that the Earth had to be hundreds of thousands of years old. Bible scholars tell us it is the synthesis of 3 different folk legends that different groups of Hebrews had developed.
But even the New Testament is not historical. Having Jesus born in Bethlehem was concocted by the early writers to fit in with OT prophecies that the King of the Jews would be born there.