Lord Shiva and Parvati had four children - Ganesha, Laxmi, Saraswati, and Kartik. Each of them had their own vahana or 'vehicle.' Ganesha, the god of wealth and wisdom, had a mouse; Laxmmi, the goddess of wealth, had a white owl; Saraswati, the goddess of education, had a swan and Kartik, the god of war, had a peacock.
One day, Shiva and Parvati were sitting together and Ganesha and Kartik were playing nearby. Shiva decided to test their strength. He declared that of the two, the sibling who first completed circling the universe thrice would be seen as being the mightier one.
Promptly, Kartik sat on his peacock and sped off on his journey around the universe. He traveled over the seas, the mountains, the earth, the moon, and the galaxies. He rushed from one place to another in his effort to beat Ganesha. He knew that with a mouse for a vahana and a large potbelly, Ganesha would never be able to compete with him.
Meanwhile, Ganesha sat peacefully at his parents' feet. He quietly got up and walked around his parents thrice. When Kartik came back, he was astonished to see Ganesha happily sitting in Shiva's lap. He could not understand how Ganesha happily sitting in Shiva's lap. He could not understand how Ganesha could have returned before he did. Being hot headed, he accused Ganesha of being unfair. Ganesha said that his parents were his universe and by circling them, he had proved himself.
Shiva was very pleased with Ganesha's wisdom. He declared that before starting any work, people would first pray to Ganesha. This is why it is considered auspicious to worship Ganesha before undertaking any task.