It is a stupid ritual and not part of Islam. I read about this practice in Saudi. The short version is that several years ago on a Hajj, people just started doing the stoning and the practice got too big to stop. When asked, the holy men tell the pilgrims that the stonings aren't necessary, but they do little to discourage it. They could stop it if they wanted to.