The Yadava clan (Bhoja, the Andhaka, and the Vrishni races) fought among themselves and died. Sri Krishna was witness to this incident.
Later, when Arjuna tried to bring the women of Vasudeva, robbers attacked him and he, being a great warrior, could not protect all the women.
Vyasa consoling him says as follows:
‘The mighty car-warriors of the Vrishni and the Andhaka races have all
been consumed by the Brahmana’s curse. O chief of Kuru’s race, it
behoveth thee not to grieve for their destruction. That which has
happened had been ordained. It was the destiny of those high-souled
warriors. Krishna suffered it to take place although he was fully
competent to baffle it.
Govinda was able to alter the very course of the universe with all its
mobile and immobile creatures. What need then be said of the curse of
even high-souled Brahmanas? He who used to proceed in front of thy
car, armed with discus and mace, through affection for thee, was the
four-armed Vasudeva, that ancient rishi.
That high-souled one of expansive eyes, Krishna, having lightened
the burden of the Earth and cast off his (human) body, has attained
to his own high seat.
Sri Krishna did allow the war with a purpose - lightening the burden of the Earth.