The three strides are older than Bali. In the Rigveda, Vishnu is the god who paces out the worlds in three steps, and the third step is set somewhere no one can follow; there is no dwarf, no asura king and no deception in those hymns. The story of a king who gives away the ground under his own feet is attached to that image later, in the Brahmanas and then fully in the Puranas, and Vamana, the dwarf, becomes the fifth avatar of Vishnu.
The Puranic version turns on a legal formality. Bali is holding a sacrifice at which he has undertaken to refuse no request. Vamana asks only for three paces of ground. Shukra, the guru of the asuras, sees exactly what is happening and tells Bali not to grant it. Bali answers that a king who has promised cannot take the promise back because the beneficiary turns out to be dangerous, which is the whole moral position the story exists to state. Shukra then tries to block the ritual water that would seal the gift by entering the spout of the vessel, and is pierced by a blade of darbha grass, losing an eye.
Bali pours the water. Vamana grows, covers earth with one stride and sky with the second, and asks where the third is to go. Bali offers his head. He is pressed down into the netherworld Patala, and in most tellings is granted rule there and the promise of a future office as Indra. The defeat is a promotion, delivered as a punishment, for a virtue nobody disputes.