The Quran is many different things, and we also have to see the Quran almost as a secondary source commenting on the Old Testament.
Once in a while you find yourself in an odd situation. You get into it by degrees and in the most natural way but, when you are right in the midst of it, you are suddenly astonished and ask yourself how in the world it all came about.