SB 7.1.12

ya eṣa rājann api kāla īśitā
 sattvaṁ surānīkam ivaidhayaty ataḥ
tat-pratyanīkān asurān sura-priyo
 rajas-tamaskān pramiṇoty uruśravāḥ
Word for word: 
yaḥ — which; eṣaḥ — this; rājan — O King; api — even; kālaḥ — time; īśitā — the Supreme Lord; sattvam — the mode of goodness; sura-anīkam — numbers of demigods; iva — certainly; edhayati — causes to increase; ataḥ — hence; tat-pratyanīkān — inimical to them; asurān — the demons; sura-priyaḥ — being the friend of the demigods; rajaḥ-tamaskān — covered by passion and ignorance; pramiṇoti — destroys; uru-śravāḥ — whose glories are widespread.
Translation: 
O King, this time factor enhances the sattva-guṇa. Thus although the Supreme Lord is the controller, He favors the demigods, who are mostly situated in sattva-guṇa. Then the demons, who are influenced by tamo-guṇa, are annihilated. The Supreme Lord induces the time factor to act in different ways, but He is never partial. Rather, His activities are glorious, and therefore He is called Uruśravā.
Purport: 

The Lord says in Bhagavad-gītā (9.29), samo ’haṁ sarva-bhūteṣu na me dveṣyo ’sti na priyaḥ: “I envy no one, nor am I partial to anyone. I am equal to all.” The Supreme Personality of Godhead cannot be partial; He is always equal to everyone. Therefore when the demigods are favored and the demons killed, this is not His partiality but the influence of the time factor. A good example in this regard is that an electrician connects both a heater and a cooler to the same electrical energy. The cause of the heating and cooling is the electrician’s manipulation of the electrical energy according to his desire, but factually the electrician has nothing to do with causing heat or cold, nor with the enjoyment or suffering that results.

There have been many historical incidents in which the Lord killed a demon, but the demon attained a higher position by the mercy of the Lord. Pūtanā is an example. Pūtanā’s purpose was to kill Kṛṣṇa. Aho bakī yaṁ stana-kāla-kūṭam. She approached the house of Nanda Mahārāja with the purpose of killing Kṛṣṇa by smearing poison on her breast, yet when she was killed she attained the highest position, achieving the status of Kṛṣṇa’s mother. Kṛṣṇa is so kind and impartial that because he sucked Pūtanā’s breast, He immediately accepted her as His mother. This superfluous activity of killing Pūtanā did not diminish the Lord’s impartiality. He is suhṛdaṁ sarva-bhūtānām, the friend of everyone. Therefore partiality cannot apply to the character of the Supreme Personality of Godhead, who always maintains His position as the supreme controller. The Lord killed Pūtanā as an enemy, but because of His being the supreme controller, she attained an exalted position as His mother. Śrīla Madhva Muni therefore remarks, kāle kāla-viṣaye ’pīśitā; dehādi-kāraṇatvāt surānīkam iva sthitaṁ sattvam. Ordinarily a murderer is hanged, and in the Manu-saṁhitā it is said that a king bestows mercy upon a murderer by killing him, thus saving him from various kinds of suffering. Because of his sinful activities, such a murderer is killed by the mercy of the king. Kṛṣṇa, the supreme judge, deals with matters in a similar way because He is the supreme controller. The conclusion, therefore, is that the Lord is always impartial and always very kind to all living entities.