There is a religious basis for this as well. The doctrine of supersession has an effect. Under this doctrine later verses in the Koran may ‘supercede’ earlier verses that the later verses directly contradict. But because both are the divine word of Allah, they are both equally true. Thus, the Muslim can accept contradictions without blinking an eye. This goes a ways towards understanding why they accept what is arrant nonsense to the western mind.
The Quran is really two volumes, one part written in Mecca (the "peace and love" volume) and one in Medina (the "slay the infidels" volume). If you look at a chapter (called surah), it says at the top either "Revealed At: MADINA" or Revealed At: MAKKA , with the Medina verses superseding the Mecca verses.
What happened in between is that (after his much-older wealthy wife died) Mo had been rejected by the pagans and Jews in Mecca, he fled with his followers to Medina, and started an alternate career as a caravan robber, which suited him better than his earlier career as gigolo.