At the time of Samudra Manthan, when God Vishnu had taken the form of Mohini; Lord Shiva got attracted to her. He had ej**ulated that time and a devil called Krodhasur was born. Krodhasur worshiped to Sun, and back in blessing, he received the power to rule the world. The gods undertook recompense to request the grace of Lord Ganesha in the form of Lambodara.
Want to read more in Hindi? Checkout: जिसके लिए ट्रोल हुए थे ट्रम्प, उस गलती को फिर से दोहराया
At the point when Lord Kartikeya had slaughtered Tarkasur, who was the ruler of asuras, Shukracharya made Mohasur decimate Devalok and execute all the Gods. To save Devlok and to do away with Mohasur, all the Gods together worshiped Lord Ganesha, and hence He incarnated as Mahodar.
Vikat avatar of Lord Ganesha was liable for vanquishing the Kamasur monster.