Muhammad had a vision from god. He came to believe that he was called on by God to be a prophet and teacher of a new faith, Islam. Muhammad believed that he himself was God's final prophet.
One of the Islamic beliefs is that there is only one universal God: Allah. So then Muhammad decided to preach that there was only one true god and some people disagreed while some agreed and later on followed him with this new religion.