The twelve animals in the cycle of the Chinese Zodiac derive from a legend about Buddha who invited all the animals to join him for New Year’s Day. Only twelve animals went to see Buddha. As a reward he promised to name a year for each one in order of their arrival, these were the rat, ox, tiger, hare, dragon, snake, horse, sheep, monkey, cock, dog and boar.
Actually the ox would have been the first to arrive but the rat sat on his back and jumped off just before they arrived and therefore was first. This also explains why e.g. the dragon appears only in the fifth place. Another legend has it that Buddha invited the animals on the day he was to leave the earth and only 12 animals showed up.
The doctrine of the twelve signs of the zodiac emerged during the Han dynasty which makes it more than 2000 years old. The signs of the chinese zodiac are also widespread in China’s neighbouring countries.