Why Ganesha is called the God of Wit and Wisdom?

Once, Shiva and Parvati were having 'the fruit of knowledge', which both Karthikeya and Ganesha wanted to have. So, Lord Shiva threw a challenge to both his sons asking them to take three rounds of the world and come back. The one who would return first would get the fruit. Karthikeya flew away on his peacock but Ganesha only had the little mice as his vehicle. So he circled around his parents and told them that his whole world lies in their feet. Shiva and Parvati were impressed with their son's answer and Ganesha ended up getting the fruit!