To clarify
robwicks' writeup with regards to the change in the direction of the Qibla: There is another reason that
Muslims believe that
Muhammad may have been ordered to change the direction, related to the level of faith of his
followers.
Initially, when Muhammad's mission began (around 610CE), the Kaaba was full of idols. Since the greatest sin in Islam is worshipping someone together with God, idols were considered a total no-no -- in fact, Muhammad's rejection of the idols is what got him into so much trouble in the first place.
In order to break connections with the Kaaba and the association of the Kaaba with idolatry, Muhammad was initially ordered to pray towards Jerusalem.
However, over the next 14 years, the faith strengthened and people came to know what it stood for; so it was no longer necessary to not face Mecca.
Four years after the change in Qibla, Muhammad conquered Mecca bloodlessly and the idols were destroyed.
This change was not an isolated incident. Another example of a change was the visiting of graveyards. In the early days of Islam, this was prohibited, as the graveyards were home to superstitious beliefs, many of them in conflict with the unity of God. This was later changed, allowing both men and women to visit graves.