Chinese Lunar calendar is a product of two independent but working together cycles - 12 Earthly Branches (Zodiac Animals) and 10 Heavenly Stems which made of 5 Primary Elements with alternating Yin-Yang polarity for each primary element.
Working together they produce so-called sexagenary 60-Years-long cycle simialar to traditional Babylonian luno-sonar 60-Years-long cycle in the ancient Western culture.
Lunar Year traditionally starts with a year of Rat and a primary element Wood. While Zodiac signs go sequentially from Rat to Boar (Pig) in 12 years cycle, each primary element changes to the next one only after it takes both Yin- and Yang polarity,
like - +Wood, -Wood; +Fire, -Fire; +Earth, -Earth; +Metal, -Metal and +Water, -Water.
In 60 years period 12 Zodiac signs make 5 full cycles from Rat through Boar, while 10 Heavenly Stems (5 Elements) manage to complete 6 full cycles from ±Wood through ±Water.
And then 60 years cycle starts again from the same point.