Shalya was the king of Madra-desa. His sister Madri was the mother of Nakula and Sahadeva. In spite of being the maternal uncle of Pandavas and wanting to fight along with them in the great war, Shalya ended up fighting for the Kauravas. He eventually took up the lead of the Kaurava army towards the end of the Kurukshetra war.
Shalya came to meet the Pandavas just before the beginning of the war to assure them of his support. He was a fierce warrior and a highly skilled charioteer. Duryodhana knew about Shalya’s arrival through his spies. He arranged for a grand reception for Shalya, who mistook it for a welcome arranged by Yudhishtira. Shalya accepted the reception and enjoyed the hospitality. At the end of it he promised his support for the host, without realising that it was Duryodhana. He felt dejected after knowing the truth, but was word-bound to support Duryodhana.
Interestingly, though he fought for the Kauravas, he did a great favour to the Pandavas during a critical phase of the war. He did this as requested by Yudhishtira. After being tricked to commit his support for Duryodhana, Shalya went to meet the Pandavas to appraise them of what happened. Yudhishtira was quick to calculate that in the critical battle between Karna and Arjuna, it is most likely that Shalya’s skills as a charioteer will be sought by Karna. He requested Shalya to demoralise Karna by his words, during this battle. Shalya agreed and kept his word by mentally weakening Karna during the key battle with Arjuna. He finally fell at the hands of Yudhishtira in the last phase of the war.