The Lord’s dharma is such that though He is impartial to all, He is prompt to save His Bhaktas from their enemies.
The Lord does not have any personal enmity towards Hiranyakasipu; but He does not tolerate the torture meted out to His bhakta, Prahlada. In a most dramatic manner He incarnates from the pillar the demon had carefully built.
In the view of interpreters, the analogy in the Sastras that describe His eyes as the sun and moon only indicates the way He looks upon His devotees on the one hand, and on those who cause harm to them on the other, said Sri O.R. Devanathan in a lecture.
Like the soothing rays of the moon, He is always kind towards His bhaktas, while the scorching effect of the sun is directed only against those who oppose and harm His devotees.
That He considers any enemy of His devotees as His own is made explicit when Krishna comes as a messenger on behalf of the Pandavas to Duryodhana’s palace. He refuses to eat there and states that one should not eat in one’s enemy’s house; neither should one entertain an enemy as a guest. He admits that He has now become an enemy to Duryodhana since he considers the Pandavas his enemy. Krishna declares that the Pandavas are His very Prana.
When the slain Vali perceives Rama’s act as plain adharma, Rama replies that dharma is most subtle and cannot be easily understood. Later Valmiki indicates that Vali subsequently realises the dharma in Rama’s act and accepts His verdict.