As Vali was older than Sugriva, he was king of Kishkindha.
The bull-asura Dundhubi came to Kishkindha and challenged Vali. "I wanted to fight Ocean," Dundhubi said, "but Ocean said Mountain was stronger. I wanted to fight Mountain, but Mountain said you were stronger. I want to fight you, Vali!"
But Dundhubi didn't know that Vali had an amulet given to him by his father, Indra, that deprived Vali's opponents of half their strength. The stronger the opponent, the stronger Vali became.
Vali grabbed Dundhubi's horns, easily smashed him to the ground, and threw his mangled corpse into the air.