The ritual of throwing seven stones at the three pillars is called Stoning the Devil and it is part of the Hajj pilgrimage to Mecca in Saudi Arabia. All Muslims who have the financial means and who are physically able are expected to go on a Hajj pilgrimage at least once in their lifetime.
There are several rituals that form part of the Hajj pilgrimage, including Stoning the Devil. It is based on a story involving Abraham, where god had issued an instruction to Abraham to sacrifice his son. The devil appeared to Abraham on three occasions trying to convince him not to obey god. Each time Abraham was encouraged by the angel Gabriel to stone the devil. Abraham did this, on each occasion throwing seven stones at the devil and successfully getting rid of him.
Muslims on a Hajj pilgrimage spend part of the time gathering up the stones required. They then recreate what Abraham did by stoning each of the three pillars seven times as a demonstration that they have totally rejected sin.
However, they are no longer actually pillars. People were getting hurt when people standing on the opposite side missed their target with the stone and hit people. The authorities in Mecca constructed three walls. This is what Hajj pilgrims now throw stones at.