Before decapitating himself, Barbarika told Krishna of his great desire to view the forthcoming battle and requested him to facilitate the same.Krishna agreed and placed the head on top of a hill overlooking the battlefield. From the hill, the head of Barbarika watched the entire battle.
At the end of the battle, the victorious Pandava brothers argued among themselves as to who was responsible for their victory. Krishna suggested that Barbarika's head, which had watched the whole battle should be allowed to judge. Barbarika's head suggested that it was Krishna alone who was responsible for the victory.
Barbarika replies, “All I could see was one thing, a divine chakra spinning all around the battlefield, killing all those who were not on the side of Dharma. Listening to this, Pandavas realized that it was Narayana who actually eradicated the Adharma from the world, and the Pandavas were mere instruments. After the war, Barbarika's head was joined with his body and he left that place for narrating the whole world to maintain peace.
https://freeglobaluniversity.blogspot.com/search/label/Barbarian