The story of Onam is associated with the legendary King Mahabali, who was a wise and generous ruler. According to Hindu mythology, King Mahabali was a powerful and benevolent king, loved by his people. His popularity and growing influence concerned the gods, particularly Lord Vishnu. To test Mahabali's humility, Lord Vishnu took the form of Vamana, a dwarf Brahmin, and approached the king for a boon. Mahabali, true to his benevolent nature, granted Vamana's wish. However, Vamana then grew in size, covering the entire universe in three steps. As there was no place left for the third step, Mahabali offered his head. Lord Vishnu was pleased with Mahabali's selflessness and granted him the wish to visit his kingdom (Kerala) once a year. Onam is believed to be the time when King Mahabali returns to Kerala to visit his people.