The stoning of the three pillars representing the devil is a symbolic reminder for Muslims to totally submit to Allah as per the example by the Prophet Ibrahim (or Patriarch Abraham) (pbuh).
According to Judeo-Christian-Islamic belief, the Patriarch made the ultimate submission to God when he was prepared to offer his son - 1st son Ismael according to the Muslim, and 2nd son Isaac according to Jews and Christians - as a sacrifice in accordance with God’s demand.
According to Islamic belief, the prophet Ibrahim (phub) was seen as all the more resolute when Syaitan (Devil) attempted 3 times unsuccessfully to prevent his act of total submission to Allah, by tempting:
(1) him not to sacrifice his son Ismael,
(2) Hagar, his Egyptian wife to stop him - (note: Hebrew wife was Sarah),
(3) Ismael, his son and the sacrifice, to avoid being sacrificed.
The symbolic stoning of Old Nick himself (or herself?) is to rebuke the Evil One in each instance of temptation, and consequently the pilgrim's resolve to fight temptation.
The ritual is the final act for pilgrims of the Hajj. The 3 Pillars of Syaitan are in the city of Mina just outside the holy city of Mecca. The preparation for the ceremony starts off with pilgrims spending the night on the plain of Muzdalifah, collecting between 49 and 70 pebbles in preparation for the rite.
The ceremony represents the riskiest part of the Hajj, not because of Syaitan, though many are not too sure now, but because of the bottleneck condition for the numerous thousands of pilgrims, packed like sardines, squeezing aggressively through the confined area. Every one of those pilgrims wants to make sure his/her pebbles hit the pillars.
In the ritual the pilgrim tries to hit each of the 3 pillars with 7 stones – don’t ask me why 7 stones, but it seems that the figure 7 carries some significance for Muslims, because the pilgrims are required to circle the Ka’aba 7 times, perform the Sa’ee 7 times, and collect 49 (7 x 7) to 70 (7 again) pebbles.
Then, once the ritual has been completed, male pilgrims will shave their head and women may cut off a lock of their hair, to symbolise rebirth. This act is to signify the cleansing of their sins through the completion of the Hajj.
Do you think the Devil might not have been too pleased with the constant pelting by pebbles, not forgetting that he is already a very nasty sort?
(1) 345 killed in Hajj Syaitan ritual
(2) Mecca Tragedy - What the Devil has been going on?