Mecca, prior to the birth of Muhammad, was already an important destination for pilgrims in Arabia. Legends abound as to the holiness of the place, but some of those legends include the Biblical Adam building a shrine there, as well as Abraham going there to sacrifice Ishmael (as opposed to Isaac) to God. The Kaaba, the large stone shrine that attracts all Muslims today, was a place of worship for believers of many different gods and saints prior to the birth of Islam. It housed around 300 idols representing the deity of each clan in Arabia.
One family controlled Mecca, regulating the care and taxation of all the pilgrims who came to the city. That family was the Quraysh, from which there were several distinct clans. One of the clans was the Hashim clan, which Muhammad was born into. So Muhammad was born, in 570, into a sort of privilege, but was orphaned at an early age, worked as a sheppard, and traveled with his uncle on caravans across the desert. He was exposed, at this point, to the monks living in the area and their beliefs in monotheism.
Muhammad became antipathetic toward the multi-theism that surrounded him, and was known to meditate for long periods in a cave outside the city. It was in this cave that Muhammad was to receive the fabled vision from God that told him of God's plan to make him the final prophet. Most Arabians were familiar with the story of Abraham, and most believed in a god called Allah. Muhammad didn't have trouble convincing them of all this, but he did have trouble convincing them not to turn their back on the supreme god. Islam itself means "submission" in Arabic.
With the strong influence of Christianity and Judaism, Muhammad believed that Abraham, Moses and Jesus were also prophets, believed in the teachings they did concerning Heaven, Hell, resurrection, judgment and the eternal life for the soul. He considered Christians and Jews as brothers, and Islam was taught with much tolerance from the beginning.
He first started preaching his new religion in 613, and was thought to be nuts for believing in a coming day of judgment, but was tolerated until he started preaching against the idol worship that pervaded Mecca at the time. His clan protected him to a point, but finally, as his following grew, the conditions grew hostile and he had to leave.
incidentally, one day while he was delivering a message he uttered phrases about various idols that seemed to indicate they were a-ok with Allah, that they were the "exalted Gharaniq whose meditation is accepted." This was first seen as pandering to the Quraysh for the acceptance of idol worship, but caused unrest among his followers. He later repudiated them in the Quran, saying that the verses came from Satan, not from God. These are known as the "Satanic Verses."
In 622, Muhammad was invited to immigrate to Medina, whose community of tribes had accepted his message very rapidly. Median is where the religion of Islam was refined, with rules and codes for living were set. A couple of notes here too. It was at this point that Muhammad began teaching that Jews and Christians had gone astray from the true religion of Abraham, which he represented. Also, he added new revelations that allowed the faithful to seek out and attack nonbelievers.
The Muslims began to attack caravans and tribes not allied with them for provisions. Soon Muhammad decided to take Mecca, but there were several battles in between the two cities, most of which went in the Muslim's favor. Treaties were signed, and then broken, and finally when Muhammad brought a large army of 10,000 to the doorstep of the city, the leaders (relatives of his) negotiated their allegiance to the Muslims. Mecca fell peacefully.
By the time of Muhammad's death in 632, most of the Arabian peninsula had united under one banner, one religion, for the first time in history. However, Muhammad left no successor to his position, and no clear rules for choosing a leader for the empire (religion). Many fell away from the faith at this point.
There were, however, four men who had the authority to take over, and they served successively as Khalifah (successors, later called Caliphs, or rulers of the Islamic Empire). The four were called the Rashidun, or rightly guided caliphs, for their devotion to Islam and their connection to the prophet Muhammad.
The first was Abu Bakr al-Siddiq, Muhammad's father in law. Abu Bakr appointed the next, Umar ibn al-Khattab, a trusted companion of Muhammad's. Under Umar, the empire grew rapidly. Part of this was due to the fact that communities captured under the Muslims were treated with uncommon tolerance. Non-Muslims were allowed to remain, keep their places of worship, and do as they please, provided they pay all the taxes imposed on them (from which Muslims were exempt). Also, the Byzantines and the Persians were weakened by decades of fighting between the two empires. By the time of his death, Umar had captured Egypt, the fertile crescent and most of Persia.
Just before his death, Umar selected 6 men to decide the successor. There were only two left of the Rashidun, Uthman ibn Affan, a respected member of the powerful Umayyad clan of Mecca, and Ali ibn Abu Talid, Muhammad's cousin and husband of his daughter Fatima. The 6 men chose Uthman.
Uthman extended the boundaries of the empire across Persia, Libya and northward to Armenia. He also created the first official written version of the Quran, which previously had been spoken by Muhammad and transcribed for copies sent across the empire. Uthman wanted to prevent incorrect versions to distort the message, so he appointed a committee to collect all the original versions and destroy the rest.
Uthman was unpopular, and accused of favoritism toward family and corruption. He was killed by a band of people led by the son of the first Caliph. Ali, cousin of Muhammad, was named Caliph in Medina. His supporters believed this long overdue, claiming he should have been first as the closest relation to Muhammad. They were called the party of Ali, or Shia't Ali (Shias for short). The majority of Muslims supported the selection process used to elect the first Caliph, and were referred to as the people of custom, ahl al-sunna, or simply Sunni.
His Caliphate was contested by a cousin of Uthman, and civil war broke out among the faithful for the next few years. Ali was killed, and Uthman's cousin, Muawiya, became the caliph uncontested, as Ali's sons chose not to press for the caliphate, thinking that it would eventually return to their family.
Muawiya began what was the first dynasty of Islam, for when he died the caliphate went to his son Yazid. After Ali's son Hassan died, his brother Husayn became the leader of the Alids. Husayn was killed in an attack while traveling from Medina to Iraq, and that is the point at which Shi'ism is considered to have become an independent sect of Islam. From that point on Shiites did not consider the Sunni caliphate legitimate, and Husayn's death is the most important annual Shiite religious observance in the world.
The Umayyad dynasty lasted until 743, and under it's last ruler, Hisham, reached it's vastest, stretching all they way to France. The Umayyads also moved the capital of the empire to Damascus. The empire had become increasingly secular in it's rule, and dispute over this led to the fall of the dynasty after Hisham died. Resistance to the secular ways of the Umayyads fueled a movement supporting a man named Abu al-Abbas, who claimed to be descendent from Muhammad's paternal uncle.
Abbas defeated the Umayyads and started a new dynasty, the Abbasids, which lasted until 1258. He subsequently moved the capital to Bagdad, further moving the empire away from it's Arabian roots. The Islamic Empire was at it's height under the Abbasids. Bagdad was the richest city in the world, the empire's ships were the largest and best on the seas. They had a highly advanced banking system. Universities were built, and science and academics flourished. But the empire proved too big, and the reliance on foreigners, like Persians and Turks, for administrative and military responsibilities, caused resentment. Revolts occurred and minor Caliphates broke out. Northern Africa broke into pieces. They Fatimids, and later the Turkish Mamluks, created an independent state in Egypt. The Seljuks, Turks from central Asia, took over Bagdad, and the Caliph was caliph in name only.
In the end, the empire was crushed by Ghenges Khan, and though he never captured Arabia, the power vacuum left by the defeat of the Abbasids left the peninsula open to other powers.