Periazhvar uses the phrase ‘ulam thottu’, when he talks of Narasimha slaying Hiranyakasipu. This means that the Lord touches the demon’s heart, before He kills him. The Lord does so to check if somewhere in some corner of Hiranyakasipu’s heart, there is some bhakti towards the Lord, said M.A. Venkatakrishnan in a discourse.
When Vibhishana approaches Rama, the latter says that He will not abandon anyone who comes with a friendly appearance, even if he has a flaw. Some people openly say they are atheists, but are actually believers. If they do have bhakti towards Him, then even if they pretend to be atheists, He does not reject them.
Acharyas have said that even if our love for God is mere pretence, He will still accept even that pretended love and bless us! Now how is this possible? Think of a cow whose calf dies. The cow’s udders are full of milk, and if the calf does not feed, the cow will suffer from pain in its udder. So, the cowherd skins the dead calf, and stuffs the skin with cotton. He then takes the stuffed calf to the cow. The cow’s love for its calf leads to milk flowing from its udders. The calf is lifeless. And yet, the sight of the stuffed calf is enough to make the cow give up its milk, as if it is a live calf. If a cow can give so much milk to a stuffed calf, will the Lord not bless a person, whose affection for the Lord may not be real? Is the Lord not infinitely merciful?
So, the Lord checking Hiranyakasipu’s heart, to see if there is some bhakti there, is only natural, for such is the nature of the Lord. The killing of Hiranyakasipu is due to His mercy. Only if He rids the demon of His body, will the atma be saved. To free the atma, He severs its connection to the body.