Pandavas performed Yagya to eliminate sins caused by the battle where thousands of soldiers including their family members, relatives were killed. They did it based on Lord Krishna's advice.