After Gods obtained Amrit (a divine nectar that grants immortality to those who drink it) from churning the ocean, they became invincible and extremely powerful.
The Asura king Mahabali then performs a big communal worship after consulting Rishi Shukracharya on how to defeat Indra, the king of Gods.
After the worship, Mahabali fought back with Indra and defeated him. Thereby, the reign of the entire universe fell in Mahabali's hands.
Gods were threatened by Mahabali's rule and Indra then pleaded to Lord Vishnu to help him find a way to regain his powers. Vishnu then decided to be reincarnated as a dwarf Brahmin to Indra’s parents, and visited Mahabali's court.
Mahabali was a pious person and when he met Brahmin Vamana, Mahabali was performing a ritual sacrifice. He welcomed Vamana and asked him what he would like to receive as a gift from Mahabali. Vamana said he only wanted as much land as he could cover in three steps.
Mahabali' laughed at this small request and agreed readily.
The young brahmin boy, Vamana then started growing in size and grew larger than the planet Earth in no time. He took his first step in which he captured the entire Earth and claimed Earth as his. His second step fell midway between Earth and heaven, which he claimed as his. Now there was no place to claim for the third step, so Vamana asked Mahabali where to keep his third step. Since Mahabali had promised three steps of land, he lowered his head and offered it for the third step. Vamana then pushed Mahabali with the pressure of his feet to the netherworlds and granted him the kingdom of the netherworlds forever.