Grandsire Bhishma was one of the greatest warriors who fought in the Mahabharata war.He had a boon by which he could not be killed by anybody. And his death had to be as per his own wish.
The details of the final battle between Bhishma and Arjuna are given in Mahabharata,Book:6, Bhishma Parva, Bhagavat-Gita Parva. When Bhishma finally fell, there was not in Bhishma's body space of even two fingers' breadth that was not pierced with arrows.
After the end of that battle{on day 10th of the war}, Grandsire Bhishma lived for 58 days on a Bed of Arrows, waiting for an auspicious day to die, as per his self-wish boon.
Then those Rishis in the forms of swans inhabiting the Manasa lake, quickly rose up, and came together, for obtaining a sight of the Kuru grandsire Bhishma, to that spot where that foremost of men was lying on his bed of arrows. Then those Rishis in swanlike forms, coming to Bhishma, beheld that perpetuator of Kuru's race lying on his bed of arrows. Beholding that high-souled son of Ganga, that chief of the Bharatas, they walked round him, and the Sun being then in the southern solstice, they said, addressing one another, these words, 'Being a high-souled person, why should Bhishma pass out (of the world) during the southern declension?' Having said these words, those swans went away, proceeding towards the southern direction. Endued with great intelligence, Bhishma, O Bharata. beholding them, reflected for a moment. And the son of Santanu then said unto them. 'I will never pass out (of the world) as long as the Sun is in the southern solstice. Even this is my resolve. I will proceed to my own ancient abode when the Sun reacheth the northern solstice. Ye swans, I tell you this truly. Expectant of the northern declension I will hold my life. Since I have the fullest control over the yielding up of my life, I will, therefore, hold life, expectant of death during the northern declension. The boon that was granted to me by my illustrious sire, to the effect that my death would depend on my own wish O, let that boon become true. I will hold my life, since I have control in the matter of laying it down.' Having said these words to those swans, he continued to lie down on his bed of arrows.
What was the Karmic reason why Bhishma had to spend the final days of his life on a Bed of Arrows?