Pandu lived a happy life in the forest with his two wives, five sons, and many other sages. But being young, he sometimes desired intimacy with his wives. One day, while wearing the clothes gifted by Madri, Pandu felt as if his body was shining like the sun. He found Madri extremely beautiful. When he touched her, following Kindama Rishi's curse, Pandu died. Disturbed by the incident, Madri handed over her two sons to Kunti and immolated herself with Pandu.
After this, the forest sages took Pandu's widow and his five sons back to Hastinapur, so they could be raised like princes in the Kuru dynasty. Pandu had foreseen his death but didn't let anyone know except his sons. He had gained special spiritual powers and knowledge through years of celibacy and meditation in the forest. He told his sons that consuming his flesh after his death would impart all that knowledge to them, making it their true inheritance.
Untold story from Mahabharat about Pandu's death
After Pandu's death, his body was cremated. Due to this, his children couldn't follow his command. However, Sahadeva noticed ants taking a small piece of flesh from his father's pyre. He picked it up and gained immense knowledge about the past and future. He intended to share this with his mother and brothers, but a stranger stopped him, asking if he was friends with God. Sahadeva answered yes. The stranger advised him not to share his knowledge without being asked and to respond to questions with questions. Later, it was revealed that the stranger was Krishna himself.
Sahadeva gradually understood that knowledge of the future could be obtained through careful observation of nature. So, he collected various occult sciences and made people capable of prophecy. As for himself, Sahadeva eagerly awaited being asked the right questions. Though people asked him many questions, precise ones were rare. Therefore, among Kunti's five fatherless sons, Sahadeva, the youngest, always remained anxious and alone.
From Devdutt Patnayak's book Jai Mahabharat