When Allah awarded Prophet-hood to our Prophet, he ordered him to continue the peaceful teachings of prophet Jesus. These instructions came in the initial 87 Meccan Surahs (verses of Quran).
Our poor Apostle toiled with these ineffective Suras for 13 years without much success. With these useless verses, he managed to convert only his immediate family, friends and a few destitute pagans. Others mocked and laughed at him. They called him a fake, a liar and a charlatan.
After his miserable failure in Mecca and not being able to convince even his own uncle and guardian Abu Talib, he went to Taef to preach Islam. They not only laughed at him, they beat him up and chased him out of the town.
Finally Meccans got so sick and tired of his sermons that they told him to take a hike or face consequences. He took a hike to Madina to save his neck.
Allah soon realized that his order of peaceful teachings cost Jesus his life and got Mohammed kicked out of his hometown.
He said enough is enough and decided to abrogate all the peaceful Meccan verses:
2:106 Whatever ayas We abrogate We bring better ones.
16:101And when We change (one) communication for (another) communication, and Allah knows best what He reveals.
Allah then decided to try a different approach to make Islam successful. He changed the rules and launched all evil acts, which were previously prohibited.
In his reformed Madina Islam, deceit, torture, murder, assassination, massacre, genocide, pillage, robbery, enslavement and rape were made halal (legal) acts, deserving of paradise, as long as they were perpetrated on infidels.
Allah also changed some social laws from his previous scriptures to accommodate existing Arab customs and habits. He permitted polygamy, temporary marriages (muta), pedophilia, marriage with adopted son's wives, wife beating, and sex with slave girls.
The new Islam became an instant hit. The Medina Suras were able to achieve in a few months what the Meccan Suras could not do in 13 years. Arabs began converting in droves and started gaining Allah's blessings as well as booty and captured women. The rest is history.