According to legends about the origin of the Chinese zodiac, animals competed in a race to decide their sequential order in the zodiac. This was known as the Great Race, and the rat won first place through wit.
Legend has it that the Jade Emperor wanted a way to measure time, so he told the animals that there would be a swimming race. The first 12 animals to cross the river would have zodiac years named after them.