The bewilderment of Maharaja Yudhisthira over his past sinful acts and the resultant sufferings, etc., is completely negated by the great authority Bhisma (one of the twelve authorized persons). Bhisma wanted to impress upon Maharaja Yudhisthira that since time immemorial no one, including such demigods as Siva and Brahma, could ascertain the real plan of the Lord. So what can we understand about it? It is useless also to inquire about it. Even the exhaustive philosophical inquiries of sages cannot ascertain the plan of the Lord. The best policy is simply to abide by the orders of the Lord without argument. The sufferings of the Pandavas were never due to their past deeds. The Lord had to execute the plan of establishing the kingdom of virtue, and therefore His own devotees suffered temporarily in order to establish the conquest of virtue. Bhismadeva was certainly satisfied by seeing the triumph of virtue, and he was glad to see King Yudhisthira on the throne, although he himself fought against him. Even a great fighter like Bhisma could not win the Battle of Kuruksetra because the Lord wanted to show that vice cannot conquer virtue, regardless of who tries to execute it. Bhismadeva was a great devotee of the Lord, but he chose to fight against the Pandavas by the will of the Lord because the Lord wanted to show that a fighter like Bhisma cannot win on the wrong side.
Source: A.C. Bhaktivedanta Swami Prabhupada (2014 edition), “Srimad Bhagavatam”, First Canto, Chapter 9 – Text 16