Lord Indra and all the Devatas got together. The cruel Rakshasas and bad people had gained power due to their continued work, money, and yagyas. They had become very powerful. The Devas decided to pray to Lord Shiva for the birth of his son Ganesha to help them out of the bad times.
Pleased with the prayers of the Devatas, Lord Shiva appeared before them. Guru Brihaspati prayed to Lord Shiva to help solve the problems. He asked Lord Shiva to help the Devas achieve success and results of hard work without any obstacles, and also create obstacles in the work of the Rakshasas.
Goddess Parvati then gave birth to a child with an Elephant-like head. The child carried a Trishul or the Ankush, the stick used to prod or awaken an elephant to action, and the Paasa or the noose to control. Ganesha was thus born, and awakened with a lot of elephant-like energy, but focussed correctly with proper guidance and control. The Devatas showered the child with flowers. Lord Shiva personally helped the child complete all rituals and master skills.
Lord Shiva then hugged the child, and said, “O son, you have been created for being a Vighnakartaa (obstacle-creator) in the path of Rakshasas, and a Vighnahartaa (obstacle-averter) to help the Devas achieve fruits of their hard work. You will destroy all evil, and bless the Devas with success. You will be recognised as Vighneshwara. Everyone will pray to you first. Lord Ganesha then created his Vighna ganas or followers to create obstacles in the paths of Rakshasas.