The ritual re-enacts Abraham's (Ibrāhīm) pilgrimage to Mecca as explained by the Muslim historian al-Azraqi:- Wikipedia, "on the sybolic significance of stoning the devil"When he [Abraham] left Mina and was brought down to (the defile called) al-Aqaba, the Devil appeared to him at Stone-Heap of the Defile. Gabriel said to him: "Pelt him!" so Abraham threw seven stones at him so that he disappeared from him. Then he appeared to him at the Middle Stone-Heap. Gabriel said to him: "Pelt him!" so he pelted him with seven stones so that he disappeared from him. Then he appeared to him at the Little Stone-Heap. Gabriel said to him: "Pelt him!" so he pelted him with seven stones like the little stones for throwing with a sling. So the Devil withdrew from him.
All three jamarāt represent the devil: the first and largest represents his temptation of Abraham against sacrificing Ishmael (Ismāʿīl); the second represents the temptation of Abraham's wife Hājar to induce her to stop him; the third represents his temptation of Ishmael to avoid being sacrificed. He was rebuked each time, and the throwing of the stones symbolizes those rebukes.
The stoning of the jamarāt also represents the repudiation of man's self (literally the "internal despot," an-nafs al-'amāra) and the act of casting aside one's low desires and wishes. As one Islamic theologian puts it,If one is able to crush al‑nafs al‑'amāra during the stoning of Jamrat al‑ʿAqaba (the Jamrah of Aqaba), then one has taken the next step in attaining closeness to Allah, and since between the servant and Allah there is no more than the distance of one step, if one has been able to take this step and make it past one's own low desires and wishes, then that which follows is the level of closeness to Allah.
During those two or three days after the Eid that one is in Mina, one must stone the three jamarāt, meaning that one must trample upon his internal despot (an-nafs al-'amāra), the external despot of the Shaitan from the Jinn (Iblīs and those like him), and the Shayṭān from among the Humans (the enemies of religion and of humanity).
The stoning of the three jamarāt is, in essence, the trampling upon the despots and waging war against all of them. When one focuses on them and the hatred for them, then one automatically focuses with complete attention upon one's self – and rightfully so – while stoning the jamarāt, one must focus entirely upon one's self.