According to the Barbareek Mahabharata story, Barbareek’s inability to participate in the war led to his beheading during it. However, he wanted to witness the Mahabharat war and pleased Lord Krishna to fulfil his desire. Thus, Lord Krishna allowed him to watch the war from the top of the hill.