The legendMahabali was the grandson of Prahlad (son of Hiranyakashyap who was slain by Vishnu in his Narasimha Avataram). Prahlad, despite being an Asura, had great faith in Vishnu. Mahabali learned the act of love and devotion to Lord Vishnu as a child, from Prahlad.
The Devas were very annoyed as Mahabali became the ruler of all the three worlds having defeated the Devas. Violence was inflicted upon the Devas. The gods approached Vishnu and asked for his help. Vishnu said to the Devas that Mahabali is doing good things to his subjects and is eligible to become sura (devas). You devas should not be jealous about that. Being jealous would make you asuras. Vishnu decided to test Mahabali.
Image via WikipediaIn the meantime, Mahabali was performing the sacrificial rite of the Viswajith Yagam or Aswamedha Yagam on the banks of Narmada River. He also declared that he would give anything that anyone sought from him during this Yagam.
Taking advantage of the Yagam and Mahabali's declaration, Vamana (Mahavishnu disguised as a Brahmin) came to the Yaga-shala. As he approached them, the sages assembled there perceived the extraordinary effulgence form of the young lad. Mahabali went forth to receive the Brahmin boy with all traditional honours and gave him an eminent seat befitting the status of a holy person. With the usual courtesy given to the people who come to ask for help, Mahabali told him that it was his good fortune that Vamana had chosen to honour him with his presence. Whatever Vamana desired, Mahabali was ready to fulfill. Vamana smiled and said: "You need not give me anything great. It is enough if you give me that extend of land covered by three footsteps of mine".
On hearing him, Mahabali's preceptor, the Brahmin Shukracharya (a Daitya priest), who had visions of the future, told Mahabali that the one who had come to take alms from him was not an ordinary Brahmin but Lord Vishnu Himself having assumed this form. He advised Mahabali not to promise the lad anything. But Mahabali was a king who would never go back on his word, considering it sinful to do so. Shukracharya insisted that he should not fulfill the demand of Vamana as he had come to deprive him of all his possessions.
Vamana, begged the pardon of his Guru for disregarding his advice.
He asked Vamana to measure the desired three feet of land. All attempts of Shukracharya to dissuade Mahabali proved futile. Mahabali considered everyone who came to him for help as god himself and never refused them anything.
Vamana grew in size until he towered above the heavens. With one footstep, he measured all of the earth. With the second, he claimed all of heaven. There was still one foot of territory that Mahabali owed him. Mahabali requested Vamana to place the final step on his head as the third step of land, for he had no other left. Vamana did so and in doing so, pushed him down to Patala, the underworld (the kingdom beneath the earth).
Vishnu's blessingsFor the devotion of this daitya, Mahabali, Lord Vishnu (Vamana) granted him rule over the underworld.
As a last gift, Mahabali was granted permission to visit his subjects once a year. Thus, Keralites celebrate the Onam festival to commemorate the memory of the Great King Mahabali who would keep his promise to visit. Mahabali fulfilled his name as the great martyr for the sake of Truth ("Satya"). The name "Mahabali" itself means Great Sacrifice.
During Onam, the feast and festive mood of the people, dressed in their best, is considered reminiscent of the prosperous and truthful life of the subjects during Mahabali's flawless reign. People wear new clothes (Vastra) during Onam. The 'Vastra' also stands for heart. Thus the significance of wearing new clothes is about making the heart new by removing all bad thoughts and feelings. People forgetting their sectarian outlooks, join together to welcome the auspicious 'Thiruvonam' day.