In the epic Mahabharata, King shalya was the brother of Madri, as well as the ruler of the Madra kingdom. Shalya, a powerful Spear and mace fighter and a formidable charioteer, was tricked by Duryodhana to fight the waron the side of the Kauravas. Shalya was an incredible calm and deliberate fighter, which is why he made a good charioteer and why he could excel at Spear and mace-fighting despite his slight build.
Etymology
Shalya means 'a pointed weapon'. His other names are Madraraj which means the King of Madra.
Becoming Pandu's brother-in-law
On his way to Hastinapur, King Pandu encountered Shalya's army. At parlay, Shalya and his general met with Pandu; Pandu was very impressed by Shalya's slight general. Shalya proposed that they could either decide the victor by war, or, by marriage. He then revealed that his general was none other than his sister Madri. Looking at her beauty, Pandu accepted the lady willingly and took her to Hastinapur, and Shalya bent the knee to Hastinapur.
Years after Madri had decided to go for sati, Shalya, each year, for a spell, brought his nephews Nakula and Sahadeva to Madra, and desired to make them his heirs. On their eighteenth birthday, Shalya revealed his intention to the twins. Shalya argued that Nakula could be a king one day, instead of fourth-in-line to the throne of Hastinapur...provided that Yudhishthira was named the crown prince in the first place. The wise Nakula pointed out that Shalya only wanted Nakula and Sahadeva as his heirs, because both were children of God-in fact, Shalya was eschewing his own children with this gambit. Nakula claimed that while he and Sahadeva staying with the Pandavas would give them no power, his brothers and Kunti genuinely loved him, and would never try to make Nakula and Sahadeva their pawns. Through some deliberation, Nakula is convinced that Shalya is being genuine. He and Sahadeva become the heirs to the throne, but Sahadeva told his uncle on one condition: they will always stay with the Pandavas.
When Shalya heard of the impending Kurukshetra War, he marched forth with his army to join his nephews. On the way, Shalya was tricked by Duryodhana, who arranged a huge feast for Shalya and his men, entertaining him for hours. Impressed, Shalya is generous with his praise and asks to see Yudhishthira, who Shalya thought was his host. When Duryodhana reveals the treachery, Shalya is astounded but is compelled to grant a boon due to the hospitality. Unable to turn down Duryodhana's request to join the Kauravas, Shalya met the Pandavas and apologized for his mistake. Nakula and Sahadeva became enraged, saying that Shalya had truly proven that Nakula and Sahadeva weren't real brothers to the Pandavas, but only step-brothers. Yudhishthira quickly stepped in and reprimanded the twins, commanding that they were never to again cheapen their relationship by saying they were "step" brothers. At this point, Shalya realised he had underestimated their brotherly bond. Yudhishthira promised to Shalya that he will kill him in war. Prior to the start of the war, Yudhishthira met with his elders on the Kaurava side, asking for their blessings. Shalya readily gave his blessings to Yudhishthira, blessing him with victory.
Though not spirited in his fight, Shalya confronted many great warriors during the war. Shalya killed Uttar Kumara on the first day of the war. Shalya killed the boy with his spear after a fantastic duel; Shalya saluted Uttar's brave death.
Second day of battle
On the 2nd day,Shalya's son Madranjaya was killed by Virata. So, he defeated and was about to kill him but Satyaki rescued him.
Thirteenth day of battle
On the 13th day, Shalya's sons Rukmangada and Rukmaratha were killed by Abhimanyu.
Fourteenth day of battle
On the fourteenth day of battle, Shalya was charged with keeping Jayadratha away from Arjuna. Shalya attempted to check Arjuna's advance. Arjuna responded by tying Shalya to his chariot using his arrows, much in the same way Abhimanyu had done the day before.
Karna's charioteer
On 17th day of battle, Karna defeats but spares Nakula and Sahadeva, saying that they are younger and not his equals, therefore not deserving of death by his hands and proceeds to clash with Arjuna. Karna-Arjuna duel begins. Unable to beat Arjuna with his own might, Karna invites Ashwasena snake on his arrow and aims at Arjuna. Shalya interrupts, telling Karna to aim at Arjuna's chest. Disgusted at Shalya's constant praise of Arjuna, Karna thinks that advice must be inaccurate, and aims at Arjuna's head. Krishna, knowing that Ashwasena is on arrow, pushes Arjuna's chariot into the ground; the arrow only takes off Arjuna's crown instead of his head. At last Arjuna kills Karna with Anjalikastra and Duryodhana names Shalya as the commander-in-chief.
Death
After becoming commander-in-chief, Shalya, now impassioned to fight for the Kaurava cause. Krishna suggests that Yudhishthira should kill the powerful warrior because the eldest Pandava was not a man of aggression and could meet Shalya's calm demeanour, in battle. Shalya is killed by Yudhishthira in spear-combat. After Shalya, Nakula and Sahadeva became the kings of Madra kingdom.