Revelation
The Koran doesn't follow chronological narrative. Its 114 chapters or suras are organized mostly according to length with the longest at the beginning and the shortest at the end.
These infallible words of god that all Muslims obey today were revealed over 1400 years ago.At that time,Mecca was the gathering place for many coexisting strands of religious beliefs. Some Arabs at the time has adopted the monotheistic beliefs of Judaism and Christianity.The pre-Islamic Mecca was a city that was inhabited by many Jews and Christians. However the religious landscape of sixth century Arabia was dominated by a pantheon of gods and goddesses.
Muhammad has been called by god and given a task of prophecy, to be the last prophet who makes this message known, and supported by the Koran.He could memorize the revelations as they came to him, and then recite verbatim to his followers. His small band of followers promptly committed to memory each new revelation they heard, adding verse after verse to the collection already in their heads. Given the oral transmission of many cultures of the time such feats of memory are unsurprising. So in a sense ,all cultures in which Muhammad lived, allowed people to listen in something for one time or even two times, and have the ability to memorize that, and be able to recite it verbatim (word for word).
Muhammad received the divine messages that would become the Koran. The revelations always seem to reflect the needs of Arab tribe folk around him. The early verses were terse and simple. They were a challenge to the pagan practices of the people of Mecca and a summons to worship one God.
The Koran was revealed gradually over 23 years, the same period as the prophetic mission of Muhammad. He preached about everything in life from religion to law, to morality.