Vishnu avatar as Vamana was nothing but the Dwarf avatar. It was the fifth avatar of all Dashavatar names. Lord Vishnu took this avatar in Treta Yuga. Bali, a descendant of Hiranyakashyap, through his devotion and penance defeated Indra and extended his authority over the three worlds. All the gods appealed to Lord Vishnu for protection and he took this avatar for the purpose of restraining Bali.
Prahlad (from the previous Avatar of Lord Vishnu as Narasimha) ruled the asuras well after his father Hiranyakashipu was killed. When Prahlad became old, his son Virochana became King of the asuras. After Virochana, his son Bali, who wanted to be equal to Indra in might, became king of the asuras.
Guided by his Guru, Shukracharya, Bali performed a yagna to become the king of the three worlds. After obtaining the blessings of his Guru, Bali took his divine chariot and conquered Indra, the king of the devas. Bali then ascended the throne of heaven and became the lord of the two worlds, and was named MahaBali. Maha means great in Sanskrit.
Aditi, the mother of Indra was sad that her son was defeated by Bali. Her husband Sage Kashyapa, advised her to pray sincerely to Lord Vishnu. Lord Vishnu listened to her prayers and was born as her son. The child soon grew but remained short, and was called Vamana, which means dwarf in Sanskrit.
Dressed in a sparse dhoti, Vamana carried a staff, a kamandala (i.e., a water pot), and an umbrella in his hand. He set out to see Bali and seek alms, as was the custom of Brahmans. Though Bali had the two worlds under his control, his desires grew limitless and he became greedy. One day, when he was performing a great sacrifice everyone saw a dwarf Brahman enter the place. This Brahman child Vamana, seemed to glow with an inner light and everybody immediately became quiet.
Bali rose from his seat to welcome him. He gave Vamana a special seat and washed his feet, as was the custom of showing respect to Brahmans. After washing Vamana’s feet Bali asked, ” O holy one, what can I do for you? Do not hesitate; ask for whatever you want – cows, elephants, horses, chariots, villages…anything!” Vamana shook his head and said, “All I need is a strip of land, three paces long, as measured by my stride.“
At that moment Guru Shukracharya, realized the truth that the Brahman child was none other than Lord Vishnu. Shukracharya tried to stop Bali in many ways but Bali said, “I have promised I shall give this Brahman whatever he asked for. Now, how can I, Bali, the grandson of Prahlad, and the emperor of the two worlds, refuse to live up to my words, like a common cheat?” So he took Vamana’s hands, and poured water and gave away the requested three paces of land. This is a ritualistic way to donate something.
As soon as Bali finished the ritual, Vamana smiled and began to grow and grow in size. He transformed himself from a small boy to a person so tall that his head reached far beyond the clouds. Everybody at that place was awestruck. They all realized this was none other than Lord Vishnu. Vamana lifted his foot and began to measure three paces. With his first stride, he covered the entire earth, and with his second stride, he covered the entire heavens. At this point, Vamana (Lord Vishnu) asked King Bali, “O’ King, you had promised me three paces of land and I have covered all that was yours in two. Where, O Bali, should I place my third stride?“
Bali realizing his folly and who he was dealing with, humbly said, “O Lord, please place your third step on my head as that is the only other thing I own.” Lord Vishnu placed his feet on the king’s head and sent him to Pataal Loka (i.e., the underworld). Thus, Lord Vishnu destroyed King Bali’s pride and greed.
Bali’s humility impressed Lord Vishnu. Bali’s grandfather Prahlad also requested Lord Vishnu to show compassion to his grandson. Therefore Lord Vishnu forgave Bali and told him that he would be a king of the underworld and when he died in old age, Bali’s soul would come to Lord Vishnu’s abode and attain moksha (i.e., the state from which a person is never born again).
The people of Kerala believe that Bali told Lord Vishnu that he loved his people very much so he wanted permission to visit Kerala once in a year. And the Lord permitted Bali to visit earth from the underworld. The day that Bali visits Kerala is celebrated as Onam. People put flower mats in front of their houses, to welcome the King.
In this way, Lord Vishnu (as Vamana Bhagwan) recovered the earth and the heavens for the Devas, from their enemy – a righteous but vain king of the Asuras BALI. After Bali’s pride was destroyed, Lord Vishnu made Indra king of the devas again.