The mythological story goes as follows:
King Bali, son of Virochana and grandson of Prahlada, was famous for his austerities.
Though a Daitya, a ruler of demons, Bali earned much merit by his virtuous deeds and his
devotion to Brahma. He became so powerful that he defeated Indra and humbled all the
Devas. The Devas appealed to Lord Vishnu for protection and he promised the same.
As King Bali never refused alms begged of him, Vishnu took the
form of a dwarfish Brahmin and appeared before Bali with a request for a small gift. Bali
asked the dwarfish Brahmin to express his desire. The dwarfish Brahmin begged of him that
he wanted just three footspaces of land where he could live. This being a very request,
Bali consented to give him the required land. The Brahmin raised his right foot and
covered the whole of the earth. Then with his left foot he covered the entire heaven. Then
he asked Bali where he could show place for the third pace. Bali showed his head.