God ordered Muslims to circumambulate Ka'ba when doing the rituals of Hajj, God says:[media_1_C]
"And (again) circumambulate the Ancient House (Ka'ba)." Surat Al-Hajj, Verse 29.
This is done for a great lesson mentioned in the book of God and clarified by the apostle of God (Blessings and peace of Allah be upon him). When God told the angels that He is going to create Adam and make him His successor on earth, they showed that they are dissatisfied to this, God says:
"Behold, your Lord said to the angels: I will create a vicegerent on earth. They said: Wilt Your place therein one who will make mischief therein and shed blood? Whilst we do celebrate Your praises and glorify Your holy (name)? He said: I know what you know not. "Surat Al-Bakara, Verse 30.
Then they regretted as they hastily showed their dissatisfaction, they asked God for repentance, God set Al-Bayt Al-Ma'moor (inhabited house) and ordered them to go round it seven times to accept their repentance, when they finished their circumambulation and He repented upon them, He ordered them to descend to the earth and build a house for His people, if they do sins as angels did, they come to it and circumambulate it as they did and then He forgives them as He forgave angels, then angels built Ka'ba about which God says:
"The first House (of worship) appointed for men was that at Bakka (Mecca): Full of blessing and of guidance for all kinds of beings."
Surat Ala-Imran, Verse 96.
When Adam did the sin and was descended from paradise, he regretted his disobedience to His God, then Gabriel came to him and ordered him to go to Mecca where the sacred house that was built by angels and circumambulate it. Adam walked from India where he was descended to the place of Ka'ba and he circumambulated it saying: (O Allah, You know my secret and my openness so accept my apology, You know what is inside my soul so forgive my sin, O Allah, I beg You a belief touches my heart so I never want to delay what You hastened nor hasten what You delayed, verily, over all things you have power.) God revealed to him: 'O Adam, you invoked Us by supplications and We accepted you, anyone from your offspring comes to this house and circumambulates it and invoked by these supplications We forgive his sins, take away poverty from between his eyes, make his richness inside his heart and trade for him better than any trader. 'This was the principle of the legislation of circumambulating Ka'ba as a duty and a pillar of performing hajj.
Circumambulation is also the worship of all stars and planets in the universe, God says:
"All (the celestial bodies) swim along, each in its rounded course." Surat Al-Ambeyaa, Verse 33.
Man imitates planets in his circumambulation as they go round the star which is their origin.
As for throwing the pebbles, this is to perpetuate Prophet Abraham, his son prophet Ishmael and his wife Hagar, Ishmael's mother. When God ordered him in his dream to slaughter his son Ishmael and his dream was repeated, he called his son and said to him as in the Koran:
"O my son! I see in vision that I offer you in sacrifice: Now see what is your view? (The son) said: O my father! Do as you are commanded: you will find me, if Allah so wills one practicing patience and constancy. "
Surat Assaffat, Verse 102.
They took a knife and a rope pretending they were going to Mina to collect firewood, Satan came to Abraham to get him not to fulfill God's order, he said to him: O Abraham, you are killing your only son for a dream? Abraham took pebbles from the ground and threw him so he went away from him, then he went to his son Ishmael and said to him: O Ishmael, you believe what your father saw in his dream? It might be a dream from Satan, talk to him and don't obey him, he did the same as his father did, he took some pebbles and threw him so he went away from him, then he went to Hagar and said to her : O Hagar, do you know where Abraham and your son Ishmael gone? He took him to slaughter him though he just saw this in his dream and he went far away so you can't stop him, go to him quickly and stop him, she also took pebbles from the ground and threw him.
When it was assured that they all surrendered to the order of God, God ransomed the boy by a momentous sacrifice Gabriel got from the heavens, God says:
"So when they had both submitted their wills (to Allah), and he had laid him prostrate on his forehead (for sacrifice). We called out to him: O Abraham. You have already fulfilled the vision, thus indeed do We reward those who do right. For this was obviously a trial. And We ransomed him with a momentous sacrifice: "Surat Assaffat, Verses 103, 104, 105, 106, 107.
God eternized their reminiscence, He made among the rituals of Hajj to threw Satan at the three places where Abraham, Ishmael and Hagar threw him.
Where is this from paganism? Paganism is to worship stones whereas Hajj is to worship The One and The Almighty Lord.