Krishna tells Arjuna when he manifests himself.
Whenever, O Bharata, loss of piety and the rise of impiety occurreth, on those occasions do I create myself. For the protection of the righteous and for the destruction of the evil doers, for the sake of establishing Piety, I am born age after age.
Notice the bolded words where Krishna tells when loss piety and the rise of impiety occurs, for the protection of the righteous and for the destruction of the evil doers, and for the sake of establishing piety, that is when he is born age after age.
In Mahabharat, gods incarnated to ease the burden of the earth because goddess earth was unable to bear the burden and herself along with many devas went to Brahma and Brahma told them to incarnate on earth.
And the Creator then commanded all the gods saying, 'To ease the Earth of her burden, go ye and have your births in her according to your respective parts and seek ye strife (with the Asuras already born there)'. ~ Shambhava Parva
Lord Vishnu approved of it also and they incarnated for the destruction of Asuras and also for the welfare of the three worlds. Asuras or demons caused chaos during Dwapara Yuga
"Vaisampayana said, 'Then Indra had a consultation with Narayana about the latter's descent on the earth from heaven with all the gods according to their respective parts. And, having commanded all the dwellers in heaven, Indra returned from the abode of Narayana. And the dwellers in heaven gradually became incarnate on earth for the destruction of the Asuras and for the welfare of the three worlds. ~ Shambhava Parva
The answer to the question can be found in this link.
Who incarnated as whom is described in What were the previous births of the characters of Mahabharata? post.
Bhishma had the boon of the past, present, and future given to him by Lord Krishna after war to instruct Yudhisthira.
"Learning by his Yoga prowess of the devotion of Bhishma, Madhava, otherwise called Hari, (entering his body) bestowed upon him heavenly knowledge compassing the Past, the Present, and the Future, and went away. "
Later, Bhishma told what Vishnu told to Narada in the beginning of the Kalpa through the grace of the boon that Krishna bestowed and also what he learned from his teachers.
these are the avatars of Lord Vishnu
I shall, assuming the form of boar and putting forth my strength, bring back the Earth with her belt of seas to her own position for the good of all creatures when she becomes submerged in water. I shall then slay the son of Diti, named Hiranyaksha, filled with pride of strength.
Assuming the form then of a Man-lion (Narsingha), I shall, for benefiting the deities, slay Hiranyakasipu the son of Diti, who will be a great destroyer of sacrifices.
Unto Virochana (the son of Prahlada) will be born a mighty son of the name of Vali. That great Asura will be unslayable in the whole universe consisting of deities, Asuras and Rakshasas. He will hurl Sakra from the sovereignty of the universe. When after routing the Lord of Sachi, that Asura will take unto himself the sovereignty of the three worlds, I shall take birth in Aditi's womb, by Kasyapa, as the twelfth Aditya. I shall (taking the sovereignty of the three worlds Vali) restore it to Indra of immeasurable splendour, and replace the deities, O Narada, in their respective stations. As regards Vali, that foremost of Danavas, who is to be unslayable by all the deities, I shall cause him to dwell in the nether regions.
In the Treta age I shall take birth as Rama in the race of Bhrigu, and exterminate the Kshatriyas who will become proud of their strength and possessions.
Towards the close of Treta and the beginning of Dwapara, I shall take birth as Rama, the son of Dasaratha in Iskshaku's royal line. At that time, the two Rishis viz., the two sons of Prajapati, called by the names of Ekata and Dwita, will in consequence of the injury done by them unto their brother Trita, have to take birth as apes, losing the beauty of the human form. Those apes that shall take birth in the race of Ekata and Dwita, shall become endued with great strength and mighty energy and will equal Sakra himself in prowess. All those apes, O regenerate one, will become my allies for accomplishing the business of the deities. I shall then slay the terrible lord of the Rakshasas, that wretch of Pulastya's race, viz., the fierce Ravana, that throne of all the worlds, together with all his children and followers.
Towards the close of the Dwapara and beginning of the Kali ages, I shall again appear in the world taking birth in the city of Mathura for the purpose of slaying Kansa. There, after slaying innumerable Danavas that will be thorns in the side of the deities, I shall take up my residence in Kusasthali at the city of Dwaraka. While residing in that city I shall slay the Asura Naraka, the son of 'the Earth,--him, that is, who will do an injury to Aditi, as also some 'other Danavas of the names of Muru and Pitha. Slaying also another foremost of Danavas, viz., the lord of Pragjyotisha, I shall transplant his delightful city furnished with diverse kinds of wealth into Dwaraka. I shall then subjugate the two gods worshipped of all the deities, viz., Maheshwara and Mahasena, who will become fond of the Danava Vana and do him diverse good offices and who will exert themselves vigorously for that worshipper of theirs. Vanquishing next the son of the Danava Vali, viz., Vana, who will be endued with a thousand arms, I shall next destroy all the inhabitants of the Danava city called Saubha. I shall next, O foremost of Brahmanas, compass the death of Kalayavana, a Danava who will be endued with great might in consequence of his being equipt with the energy of Gargya. A proud Asura will appear as a king at Girivraja, of the name of Jarasandha, who will quarrel with all the other kings of the world. His death will be compassed by me through some one else guided by my intelligence. I shall next slay Sisupala in the sacrifice of king Yudhishthira, the son of Dharma, which sacrifice all the kings of the world will bring tribute. In some of these feats, only Arjuna, the son of Vasava, will become my assistant. I shall establish Yudhishthira with all his brothers in his ancestral kingdom. People will call me and Arjuna as Narayana and Nara, when, endued with puissance, we two, exerting our strength, shall consume a large number of Kshatriyas, for doing good to the world. Having lightened the burthen of the Earth according to our pleasure, I shall absorb all the principal Sattwatas as also Dwaraka, my favourite city, into my own self, recollecting my all-embracing Knowledge.