This story is based on the Narasimha Avtar or the fourth incarnation of Lord Vishnu to protect his young devotee PRAHLAD. When demon king HIRNAYAKASHYAPU learnt the death of his brother HIRANYAKSHYA in the hands of LORD VISHNU. He bowed to kill LORD VISHNU and his devotees. With this in his mind, he did great penance to appease LORD BHRAHMA and got several boons. He got boon that he should not be killed by any living or dead creature, any created thing on earth or sky, at night or day, inside or outside, by man or beast, celestial beings or Asuras, by any poisonous beings alive or dead or by any weapons.
After receiving this boon, he fought with Indra the chief of Gods and defeated him in the furious battle. Then he started tormenting people and devotees of LORD VISHNU. During, this process HIRANYAKASHYAPU's wife while she was pregnant, was taken away by INDRA. The sage NARADA stopped them on the way and expalined her the glory of MAHAVISHNU. This was being heard by the foetus. The foetus became devotee of LORD VISHNU,hearing the words of NARADA.When the baby was born to HIRANYAKASHYAPU,he was named PRAHLAD meaning supremely happy.
PRAHLAD was sent to GURU SUKRACHARYA to learn administration and other subjects. SUKRACHARYA started to inculcate the new syllabus given by HIRANYAKASHYAPU to worship him as GOD.However, he could not instill the heart of PRAHLAD to worship HIRANYAKASHYAPU. He could not divert the attention of PRAHLAD from his attachment to LORD VISHNU.
Having failed in his attempts, SUKRACHARYA complained to HIRANYAKASHYAPU, who became angry with his son. HIRANYAKASHYAPU tried to kill his son for his devotion to LORD VISHNU.
One day, HIRANYAKASHYAPU called PRAHLAD and gave him milk, to which poison was added. PRAHLAD took the milk and chanting "OHM NAMHO NARAYANA and OHM AMRUTAY NAMAH" drank the whole milk. He was not affected by the poison in milk because of his devotion to LORD MAHAVISHNU.
Then HIRANYAKASHYAPU ordered PRAHLAD to be cut into pieces,however the weapon used got broken into pieces.
He had him cast away in ocean. But, the LORD of Ocean brought him back unaffected.
He was hurled from the mountain top, but was saved by the hands of Vishnu.
He was left to be bitten by poisonous snakes, but the LORD who reclines in the ADISHESHA saved him.
He then ordered his sister HOLIKA to take him with her in fire. As HOLIKA had a boon to walk through fire unaffected. However, PRAHLAD was saved by the LORD VISHNU and HOLIKA was burnt to ashes for playing fowl with a boon.
In all these above incidents PRAHLAD was not affected and remain cheerful , for his devotion to LORD VISHNU. The Mantra that he kept chanting is from VISHNU SHAHASHRANAMA. The Mantra " OHM AMRUTAY NAMAH", is to turn the bitter poison to taste like AMRUT.
For his devotion to LORD VISHNU, VISHNU finally took the form of NARASIMHA, his 4th incarnation to kill HIRANYAKASHYAPU and restore faith and devotion on him.
The small child PRAHLAD was not affected by the tortures and torments his father gave to him, because LORD VISHNU transformed the venom into sweet, that could be taken by him. He transformed the fire that it won't burn PRAHLAD slightly. This is the devotion on GOD which transforms the greatest misery into pleasant thing, that could be taken by us.
By chanting the Mantra with utter devotion, we pray to GOD to make the unpleasant things around us to transform into something pleasurable.
"OHM AMRUTAY NAMAH"