As the story – Gandhari was told that her first husband will die so she marries a goat first and after she was married to king Dhrutharastra .
When pandavas and Kauravas were children they always thrown verbal tantrums and involved in fighting with each other .Once in a heated argument Dhuryodhana said that Kunti gave birth to pandavas with blessing of various gods and pandavas father Pandu was unable to give.
Furious by this statemetn Bheema says Gnadhari is already married and kauravas are from a woman who married second time.
Duryodhana goes to home and asks gandhari about this and she says that it is true .Furious by this he imprisons all Gandhari family members includind Shakuni who is very young at that time -who kept this information as secret .Every day just a grain of food is being served to every prisioner .Shakuni father tsays to his family mamebers that this will kill all of us and one has to survive so that he can take revange on kauravas. Father chooses Shakuni and So they give all of their grains to shakuni everyday. So shakuni will be alive and all other will be dead.
Before breathing his last, Subala father of Shakuni requested dhritharastra to set Shakuni free and also take care of him, promising him that his son, in turn, would always take care of and protect Dhritarashtra’s sons. By that time, Dhritarashtra had a hundred sons and one daughter. He took pity on his father-in-law and agreed to fulfill the elder’s requestAfter Shakuni released from prision he takes ashes of his father and forms his Dice which will lsiten to him only
On the penultimate day, that is, on the eighteenth day of the Kurukshetra war, Sahadeva faced Shakuni on the battlefield. Being the wisest of the Pandavas, Sahadeva knew exactly what the latter’s motive was, and the actual reason why he waged war against the Pandavas – in order to seek revenge. Sahadeva told Shakuni that he should stop fighting, since he had already achieved what he wanted to. He asked him to go back to his kingdom, Gandhara, and rule, instead of participating in this meaningless violence and killing.
In that moment, Shakuni felt deep remorse and a genuine repentance for all that had transpired in the recent past. He suddenly felt like opening out to this young man standing in front of him – to talk to him, like an elder does to a younger member in a family. He recounted to Sahadeva all his childhood events; how his whole family had been tortured at the hands of Dhritarashtra; and how his sister had suffered marrying a blind King. He admitted to having poisoned Bheema; planning the Lakshagraha incident; chalking out a strategy to kill Abhimanyu and so on. He also confessed to all the other crimes he had committed in this lifetime and told the young man that he could no more bear to live on; carrying this load of remorse and guilt for all the evil deeds he had done in this lifetime.
Shakuni finally revealed his good side – something that no one ever imagined existed! He told Sahadeva that the only thing left for him to do would be to sacrifice his life on this very battlefield. He further stated that it would be an honour for him to shed his mortal coil in a battlefield as great as Kurukshetra; in a place where such great Maharathis (mighty warriors) had fought and been martyred.
Once he had finished saying all that he had to, Shakuni started attacking Sahadeva with arrows. He knew he had to die and so, was spurring on the latter to kill him. After a brief fight, Sahadeva cut off his head. That marked the end of evil – the slaying of Shakuni
some paragraphs of Article source – http://www.dollsofindia.com/library/shakuni/