The sages Sanaka - Sanandana, Sanaathana and Sanathkurma were holiness incarnate. One day they went to Vaikunta to see Maha Vishnu. The two gate-keepers Jaya and Vijaya refused in his private chamber. The sages cursed the gate keepers - "May you be born in the world as demons filled with lust, anger and greed" and proceeded to go in sages with due respect. Jaya and Vijaya realized their folly and begged the sages to save them. The sages pleaded inability and went away. The two fell at the feet of Maha Vishnu and entreated him to save them. The Lord said, "Though I can do it. I do not propose to help you. I wish you are born in the world leading your life as my enemy. You will then realize my real nature and you will return to me and spend your time in the same status quo".
These tow gate keepers were born as Hiranyakasaipu and Hirayanaaksha to sage Kaasyapa and his wife.
The demons grew up rapidly. Hiranyakasipu the elder of the two became most powerful and ruled over the three worlds. The Devas were conquered and enslaved. We can imagine the plight of men. The whole world trembled at the very mention of their names.
Lord Vishnu decided to save the world and the Devas. The demons came to know of it. They could easily guess that Maha Vishnu would incarnate to save the world but in what form they could not guess. Blindly the brothers came to this conclusion. Hiranyaaksha the younger told his brother Hiranyakasipu, "Brother I am sure this Hari will never keep quiet. When once he makes up his mind he does act. We cannot guess in what manner and form he is going to come down to earth this time. So what I am going to do is I would roll the earth, keep it under my armpit and hide at the bottom of the vast sea. Then I am sure Vishnu or any one would be unable to find out the earth".
"Do so my brother," said Hiranyakasipu.
So Hiranyaksha rolled the world and hid himself in the deepest abyss of the vast ocean.
Brahma who was just then in the act of creation felt the world going down and after a little concentration understood the real position. He thought for a while as to what to do to save the world and left the work to Lord Vishnu who was his creator.
Just then there issued a little Boar, all on a sudden, of the size of the Thumb. Even as the creator was looking on, the boar which was standing in the air, grew as big as an elephant in a moment. It grew and looking like a huge mountain, it roared terribly.
Suddenly the Boar dived into the water and went out of sight. Hiranyaaksha saw this gigantic animal diving towards him. He understood the purpose of the Boar and laughed loudly at it. He said, "O! Pig, why have you come here and what can you do me?" Sri Varaha replied, "Oh Demon! Whenever there is a decay of righteousness and there is exaltation of un-righteousness, I come forth to such a place to protect the good, to destroy the evildoers and to establish righteousness. To fulfill it, I take the suitable form at my own will as I deem it fit. I have taken this form of the Royal Boar to conquer a demon pig like you. Come we shall fight without more words." The fight began and Lord Hari in the form of the divine boar killed the demon and brought the earth carrying on its long powerful tusk and put it back on its place.
Rescuing the earth from Hiranyaaksha by killing him seems to be the aim of this mighty Boar incarnation.