Common lores.
And the 12 is a funny story.
It was once said that the Celestial Courts ordered for a race, and the top 12 would be allowed entry into the Courts. At that time, Rat and Cat were the best of friends, and they agreed to wake each other up for the race so that both can enter the Courts. However, on the day of the race, Rat went back on his word, and hitched a ride on Ox. By the time Cat woke up, the race was already over, and she swore revenge on Rat.
Hence why cats chase after rats/mice.
As for the order of the 12, as mentioned, Rat hitched a ride on Ox's head, and on nearing the finishing line, Rat hoped off, and came in 1st, with Ox in 2nd and so on (Tiger 3rd, Rabbit 4th, Dragon 5th, Snake 6th, Horse 7th, Sheep 8th, Monkey 9th, Rooster 10th, Dog 11th, Pig 12th). As to why Dragon was fifth since he could fly, it was a race, hence all animals were running. On the ground. Dragon was not used to running with his legs, but managed to beat 7 others.
AS IT IS TOLD, IT IS TRUEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE *thunders*