Hinduism believes that God incarnates Himself on earth to uphold righteousness, whenever there is a decline of virtue. Thus declares Sri Krishna in the Bhagavad Gita (BG 4.6, 4.7):
“Whenever there is decline of righteousness and predominance of unjust, I embody Myself. For the protection of the good and for the destruction of evil and for the reestablishment of dharma (righteousness) I am born from age to age.”