The relationship between Chiang Kai Shek and Mao Zedong was primarily adversarial, fighting each other in the Chinese Civil War (1927–1949). Chiang Kai Shek led the Kuomintang (Nationalists), and Mao Zedong led the Communists. Ultimately, the Communists (CCP) won the war, and by 1949 Chiang Kai Shek and what was left of the Nationalist KMT party fled to the island of Taiwan, then more commonly known as Formosa, where they established the Republic of China (ROC) government on the island, where it remains to this day.
Still to this day, both the ROC and CCP claim to be the legitimate governments of all China, which is a major point of contention between both entities, especially in regards to the claim of the island of Taiwan. This is one of the most precarious geopolitical situations in the world today.
The relationship between the two is rather complex if we look at the historical background of these two leaders. For a time, the Chinese Civil War was halted to fight the Japanese, first from 1932–33 and then again from 1937–45. Although there was an agreement to fight the Japanese together, it was more of a cease fire between the two, and the KMT did the bulk of the fighting against the Japanese, which ultimately weakened them and allowed for a decisive victory for the CCP by 1949.
Both leaders also claimed to be the legitimate political heir to Sun Yat Sen, who founded the Republic of China after the collapse of the Qing Dynasy in 1911. In both China and Taiwan today, Sun Yat Sen is still revered and seen as the founder of each respective government. This relationship exists because although Sun Yat Sen was the Nationalist and KMT leader until his death in 1925, initially he had accepted support from the Soviet government of Russia when his government was in its fledgling stage. Mao Zedong took this as proof that Sun Yat Sen was a supporter of communism and an anti-imperialist.
After Sun Yat Sen's death, Chiang Kai Shek was the heir apparent and became the leader of the KMT. He was unable to get the kind of broad support and foster the cooperation that his mentor had, and within two years, war had broken out between the Communists and Nationalists.
After his defeat by the Communists in 1949, Chiang Kai Shek fled to Taiwan and had plans to retake China until his death in 1975. The two remained tense rivals until the mid 1970s and even attacked each other again after the civil war had ended during the 1950s.