SB 11.1.2

ye kopitāḥ su-bahu pāṇḍu-sutāḥ sapatnair
 durdyūta-helana-kaca-grahaṇādibhis tān
kṛtvā nimittam itaretarataḥ sametān
 hatvā nṛpān niraharat kṣiti-bhāram īśaḥ
Synonyms: 
ye — they who; kopitāḥ — were angered; su-bahu — excessively, time and time again; pāṇḍu-sutāḥ — the sons of Pāṇḍu; sapatnaiḥ — by their enemies; duḥ-dyūta — by duplicitous gambling; helana — insults; kaca-grahaṇa — grabbing the hair (of Draupadī); ādibhiḥ — and other impetuses; tān — them (the Pāṇḍavas); kṛtvā — making; nimittam — the immediate cause; itara-itarataḥ — confronting one another on opposite sides; sametān — all assembled; hatvā — killing; nṛpān — the kings; niraharat — took away once and for all; kṣiti — of the earth; bhāram — the burden; īśaḥ — the Supreme Lord.
Translation: 
Because the sons of Pāṇḍu were enraged by the numerous offenses of their enemies, such as duplicitous gambling, verbal insults, the seizing of Draupadī’s hair, and many other cruel transgressions, the Supreme Lord engaged those Pāṇḍavas as the immediate cause to execute His will. On the pretext of the Battle of Kurukṣetra, Lord Kṛṣṇa arranged for all the kings who were burdening the earth to assemble with their armies on opposite sides of the battlefield, and when the Lord killed them through the agency of war, the earth was relieved of its burden.
Purport: 

The Pāṇḍavas were repeatedly harassed by their enemies, such as Duryodhana and Duḥśāsana. As innocent young princes, the Pāṇḍavas had no enemy, but Duryodhana was constantly plotting against his helpless cousins. The Pāṇḍavas were sent to a house of lac, which was later burned to the ground. They were administered poison, and their chaste wife Draupadī was publicly insulted when her hair was pulled and an attempt was made to strip her naked. Throughout these dangers, Lord Śrī Kṛṣṇa constantly protected the Pāṇḍavas, who were fully surrendered to Him and who knew no shelter other than Him.

In this verse the word itaretarataḥ is significant. Previous to the Battle of Kurukṣetra, Kṛṣṇa had personally killed many demons, including Pūtanā, Keśī, Aghāsura and Kaṁsa. Now, Kṛṣṇa wanted to complete His mission of removing the earth’s burden by killing the remaining impious persons. But as stated here, kṛtvā nimittam: the Lord did not personally kill, but empowered His devotees Arjuna and the other Pāṇḍavas to remove the impious kings. Thus acting personally and through His immediate expansion Balarāma, as well as by empowering His pure devotees such as the Pāṇḍavas, Kṛṣṇa fully displayed the pastimes of the yugāvatāra by reestablishing religious principles and ridding the world of demons. Although the general purpose of the Kurukṣetra battle was to kill the demons, by Kṛṣṇa’s arrangement some great devotees such as Bhīṣma also appeared to be inimical toward the Lord. But as described in the First Canto of Śrīmad-Bhāgavatam (1.9.39) by the words hatā gatāḥ svarūpam, many great devotees played with the Lord as enemies and upon being killed by Kṛṣṇa returned immediately to His abode in the spiritual sky in their original spiritual bodies. Because God is absolute, by His killing He simultaneously removes the demons from the earth and encourages His pure devotees.