Prior to the Battle of Red Cliffs, Cao Cao's troops and the Eastern Wu troops had a naval battle in which the outnumbered Wu troops defeated Cao Cao's troops. Cao Cao was furious with the defeat and after discussion with his generals, he realised that most of his troops came from Northern China and were not familiar with naval warfare. Cao Cao ordered Cai Mao and Zhang Yun, who both formerly served Liu Biao of Jingzhou, to construct a naval base for training the troops in naval warfare.
Zhou Yu was disturbed by this and pondered how to get rid of the two generals, who were quite adept in naval warfare and were in charge of overseeing the training of Cao Cao's troops. Later, Jiang Gan offered to go to the Eastern Wu camp to persuade his old schoolmate Zhou Yu to defect to Wei. Cao Cao was overjoyed and sent Jiang Gan off to Eastern Wu.
Zhou Yu heard of Jiang Gan's arrival and was delighted as he intended to use Jiang Gan to get rid of Cai Mao and Zhang Yun. When Jiang Gan arrived, Zhou Yu received him warmly and even asked him whether he was here to persuade him to serve Wei and if so, Jiang Gan would not be welcome. Jiang Gan denied and Zhou Yu threw a banquet in his honour as a reunion affair. Before the banquet, Zhou Yu handed his sword to Taishi Ci, giving him the authority to execute anyone who spoke of military affairs as the banquet was meant to be a joyous and relaxed occasion in which no affairs of the state would be discussed. Jiang Gan was afraid and decided not to speak to Zhou Yu about serving Wei yet.
After the banquet, Zhou Yu pretended to be drunk and showed Jiang Gan round his camp. He showed Jiang Gan how full his granary was and the might of his troops. Jiang Gan was intimidated by the sight of the military prowess of the Wu troops and did not dare to speak anything regarding surrendering to Wei to Zhou Yu. Later, Zhou Yu wanted Jiang Gan to sleep with him on the same bed that night just like in their schooldays. Jiang Gan could not sleep peacefully and he crept out of bed that night to browse through Zhou Yu's documents.
Jiang Gan found a letter addressed to Zhou Yu from Cai Mao and Zhang Yun, and he opened the letter quietly so as not to wake Zhou Yu up. Jiang Gan read the letter and was shocked when he found out that Cai Mao and Zhang Yun were planning to kill Cao Cao and defect to Eastern Wu. Jiang Gan was happy that although he did not manage to complete his mission (to persuade Zhou Yu to join Cao Cao), he discovered an important military secret of Eastern Wu. Zhou Yu pretended to wake up from his sleep in the middle of the night and vomited by the bedside. He said groggily to Jiang Gan, "Ziyi, in a few days time, I will show you Cao Cao's head."
Jiang Gan thought that what was written in the letter was true and quietly sneaked back into bed. Later, Zhou Yu's subordinates woke him up and Zhou Yu pretended to have awoken from his state of drunkenness. The subordinates told him to go outside the tent to tell him of some important military news. Jiang Gan crept out of bed again and eavesdropped on the conversation, hearing them mention plans of Cai Mao and Zhang Yun assassinating Cao Cao. Jiang Gan sneaked out of the Wu camp and went back to the Wei camp with the letter.
Jiang Gan showed Cao Cao the letter and Cao Cao was furious. He summoned Cai Mao and Zhang Yun and asked them why the construction of the naval base was delayed. Cai Mao and Zhang Yun tried to explain but Cao Cao cut them off, saying "By then, my head would have already been in the hands of Zhou Yu!". Cai Mao and Zhang Yun were puzzled and Cao Cao ordered them to be executed immediately. Jiang Gan seemed pleased that he had made a great contribution by exposing the treachery of Cai Mao and Zhang Yun.
Suddenly, Cao Cao realised that he had been tricked by Zhou Yu and ordered the executioners to hold on, but was too late as Cai and Zhang had already been executed. Cao Cao did not want to admit that he had been tricked and forced himself to praise Jiang Gan for exposing the treachery although he was fuming inside. Jiang Gan had not realised that this was a scheme all set up by Zhou Yu to get rid of Cai Mao and Zhang Yun and was pleased with himself.
Later, Cao Cao decided to send Jiang Gan again to spy on Zhou Yu but many of Cao Cao's advisors objected. Nevertheless, Jiang Gan still went to Eastern Wu. At that time, Zhou Yu was planning his attack on the Wei camp when he heard of Jiang Gan's arrival. He laughed again and decided to make use of Jiang Gan to aid him in completing his plan. Zhou Yu pretended to be furious with Jiang Gan, saying "Last time, you stole the letter and allowed military secrets to be leaked out, causing my plan to end up in failure." Zhou Yu wanted to have Jiang Gan executed but on account of their past friendship, he ordered to have Jiang Gan barred from entering his camp.
Jiang Gan wandered to a nearby temple and met Pang Tong. After a conversation with Pang, Jiang recognised Pang's talent and tried to recruit him into Cao Cao's camp. Pang agreed and went back to Wei with Jiang Gan. This was meant to be a ruse as Pang Tong and Zhou Yu had agreed beforehand on this plan. Pang was to meet Cao Cao, who would not suspect him, and suggest to Cao Cao the strategy of 'linking the battleships together with iron chains', which would later cause Cao Cao's defeat in the Battle of Red Cliffs.