how does Chinese legend explain the order of the animals in the zodiac

According to Chinese legend, the order of the animals in the zodiac was determined by a race that was held by the Jade Emperor, the ruler of heaven. He invited all the animals in the world to participate in the race, and the first twelve to cross the finish line would be assigned a year in the zodiac cycle.

The rat and the cat were best friends, and they agreed to wake up early and race together. However, on the morning of the race, the rat tricked the cat into oversleeping so that only he could make it to the finish line in time. This is why the rat is the first animal in the zodiac, followed by the ox, tiger, rabbit, dragon, snake, horse, goat, monkey, rooster, dog, and pig.

The cat was so upset by the rat's betrayal that it vowed to hate rats forever, which is why cats and rats are said to be enemies. This legend explains both the order of the animals in the zodiac and the animosity between cats and rats in Chinese culture.