In my article “Original function of mosques and their role today”, the issue of mosques was discussed as places for worship and other activities. Many add their own thoughts that the five daily prayers can be performed at home or in a nearby mosque, for Friday worship it is better to have a mosque, for the Feasts (Eid) a larger mosque or center is advisable and Mecca, the largest sanctuary of Kaaba receives millions of pilgrims a year.
Regarding worship the place has no importance because Allah has made the whole earth suitable for prayer:
…The earth has been made for me (and for my followers) a place for praying and a thing to perform Tayammum, therefore anyone of my followers can pray wherever the time of a prayer is due. Sahih al-Bukhari 335
But let’s talk about Mecca and the direction of prayer, i.e. the Qibla. Many misunderstandings in this regard need to be dispelled. We are not praying in that direction because of the “sanctity” of Kaaba, but because of the “sanctity” of Mecca! The Kaaba is only a symbol, but it is not the object for prayer. If we'd worship, kiss, touch the Kaaba, we would be no different from idolaters. It is unfortunate that masses are doing that. There is no “holiness” for Kaaba, it has been devastated many times in history, but it has always been rebuilt. Black stone has a separate history, the theophany that belong to it has a “sanctity,” but now these stories don’t represent the subject of the article. The significance of stone is the direction of prayer. Al “sanctity” belong to the city, Mecca. This is the place where Monotheism is linked to. And now I am not talking about Mohammad, Abraham, and the story of Adam, Eve (peace be upon them all), but practically about the creation of the earth. So, about the period before Adam and Eve:
It was included in “Al-Musnaf” 9098 by Abdul-Razzaq, and Al-Azraqi in the Akhbar of Makkah 1/31, and Ibn Abi Hatim in "Al-Tafseer" 1235 in the “Heel of inks” said: „The Kaaba was a dry plot in the water for forty years before God (may Him be glorified and magnified) created the heavens and the earth, and from it was the earth departed.”
Well, this is the “sanctity” that makes Mecca for virtually every Monotheism as the alpha and omega.
So, what was this dancing back and forth with the direction of prayer regarding Mecca and Jerusalem in the time of Muhammad (peace be upon him)?
Mohammad (peace be upon him) as long as he taught his followers in Mecca, prayed towards the direction of Kaaba. In 622 he and his followers fled to Medina (Hijra). There were significant Jewish tribes among the inhabitants of Medina. The Prophet made a gesture to them by changing the direction of prayer to Jerusalem. It didn't last more than 16 months! Then came the order from Allah to restore the direction of prayer (Qibla) back to Mecca, i.e. to the Kaaba.
The fools among the people will say: "What hath turned them from the Qibla to which they were used?" Say: To Allah belong both east and West: He guideth whom He will to a Way that is straight. (Quran 2:142)
New chapter starts. Don’t forget that Baqara Surah revealed in Medina and is the longest Sura which serves as „Constitution of Islamic State”. It gives arguments for the True Faith, for why Mohammed (peace be upon him) was chosen for the revelations and not a Jewish prophet, what are the everyday regulations and spiritual prescriptions. Also, it is important to form Umma, society of Islam. However, Umma needs cohesion and one of the strongest strengths what can melt people together is the prayer. Mohammed (peace upon him) got revelation from Allah to change the Qibla (direction of prayer). Muslims used to pray towards the Temple of Jerusalem like Jews. Christians had no specific Qibla. After the continuous revolt of Jews in Medina and after the ayas which were revealed before arguing that Abraham, Ismael and Isaac were on the “Hanif” way and Mecca was the origin of the true Monotheism, the Qibla changed. Changing Qibla is not easy. People may hesitate, accept and refuse. But Allah did it in order to make the Prophet see who follows him from heart and who don’t. This event served as the first trial to form a devoted Umma in Islam.
“Yahdi man yasha” can be translated two ways. It means that Allah guides whom He will. In this way Allah’s will decide who will be guided. The second meaning of the same sentence is that Allah guides the person who is going to earn Allah’s guidance. I think that this way of translation reflects the concept of Quran better regarding free will to choose between Guidance and mislead.
We see the turning of thy face (for guidance to the heavens: now Shall We turn thee to a Qibla that shall please thee. Turn then Thy face in the direction of the sacred Mosque: Wherever ye are, turn your faces in that direction. The people of the Book know well that that is the truth from their Lord. Nor is Allah unmindful of what they do. (Quran 2:144)
So, it was not the insidious cunning of Mohammad (peace be upon him) that he turned the people once to the right then to the left to see who would follow him blindly, but he did everything by following the command of Allah (SWT). It is another issue that this really gave him an opportunity to realize, who follows him from a pure heart, without doubt, and who has anxiety and uncertainty. But the Prophet had nothing to do with this decision.
I know there are many other stories that could be told about Kaaba, but at this time I just wanted to go back to the beginning and the end.