For info about how Red China has been portrayed in media, see here.
The world was very surprised when the Chinese government's attempts at crushing some communist rebels that nobody had ever heard of dragged on into its second year. But they were shocked when said rebels exterminated the government's troops in Manchuria, and started winning what started to look more and more like a civil war. Just two years later, the rebels had won, and Communist China was a reality. Though this turn of events was a shock at the time, one that particularly dismayed haters of socialism everywhere, it didn't come from nowhere.
The Red Army's victory in the second phase of the Chinese Civil War meant the conquest of Republican China, from which the Guomindang fled to Taiwan with a few hundred thousand soldiers, a couple of million refugees, and most of the national treasury. Soon crushing the remainder of the Guomindang's forces and the remaining semi-independent warlords who had been aligned with them (like Yan Xishan of Shanxi province and the 'New Guangxi Clique' of, you guessed it, Guangxi province), the Communist Party of China declared the establishment of the People's Republic of China in 1949. At least twenty million people (of a total population of no more than 500 million) had died from famine-related diseases as a consequence of the Second Sino-Japanese War of 1937-45 (fought between Imperial Japan and the Guomindang) and the latter phase of the civil war (fought between the Guomindang and the unified Chinese Communist Party), in addition to the several-million soldiers who died of tropical and other diseases, exposure, exhaustion, and gunshot and shrapnel wounds.
The Guomindang, of course, were no saints themselves - since 1911, China had descended into an age of faction-fighting and political extremism marked by great brutality and summary executions on all sides. Chiang Kai-shek was not squeamish about ordering the extermination of all the socialists in the Guomindang, for instance, in the middle of the 'Northern March' of 1927 (wherein the Guomindang-Communist coalition was attempting to unify the country under a single government vis-a-vis the use of brutal force). The Communist Party of the time didn't really hold that against him, for instance, because they had been planning to do exactly the same thing to the 'moderates' and 'rightists' in their coalition - just at a later date. Chiang also courted fascism as a way to consolidate his hold over the towns and cities of the mid-lower Yangzi that his Guomindang regime controlled, and that constituted his power-base; neither was Chiang's China afraid to be associated with Weimar Germany and the Nazis, making a deal in the middle of the great depression to basically sell grain, iron, and rare-earth materials to Nazi Germany in exchange for entire (Mauser-Werke) armaments factories. In fact, Sino-German co-operation only ended in 1937 with Japan's invasion of Guomindang China and Germany's recalling of General Alexander Von Falkenhausen (on threat of harm to his family, who were in Germany), who was both helping Chiang plan his defence of the Lower Yangzi and commanding Guomindang armies.
In the USA in particular, China and Asia in general had long been vilified in popular culture—but they were seen as a lesser evil compared to Soviet Russia, at least partly due to the tentative Guomindang-USA alliance that resulted when Japan brought the Dutch, Britain, and the USA into its war on China. The USA's support for the Guomindang was rather lukewarm throughout the war and especially during the post-war and civil war period, but the USA held a generally fond (though condescending) attitude towards the Chinese people throughout, not least because an independent China (whether Guomindang or Socialist) would be a natural counter to Soviet influence in East Asia. That said, the USA did try to get the maximum use out of the Guomindang (to serve as a base for bombing the Japanese Home Islands and to tie down the Imperial Japanese Army) for the least effort expended; lend-lease aid to China was minimal, constituting enough arms and equipment for a mere hundred-thousand troopsnote .
It was during the war that the Guomindang's gradual implosion began, and that Red China became a serious possibility. If it were not for the advent of war with Japan, Chinese Socialism would have been totally eradicated by 1940. As it was, the strain imposed by eight years of total war against a vastly superior foe destroyed the Guomindang. Soviet aid dried up entirely in 1939 after the conclusion of the Soviet-Japanese non-aggression pact, and it was in those two years of going it totally alone that the Guomindang was forced to destroy itself to survive. In giving up its powers of taxation, administration, and conscription it created golden opportunities for corruption and graft at the local level by those nobles and landlords empowered to govern in its place. American loans staved off the monetary crisis and the Guomindang's imminent disintegration in the first half of 1942, but the regime never really recovered as it didn't have the money to wean itself of its dependency on local-government for conscripts and administration.
It was in this environment of total war that the Chinese Communist Party (CCP) were able to flourish, trying to instigate open battles between Japanese and Guomindang forces while focusing solely on building up their own power-bases in the rural and particularly the Japanese-'occupied'note areas. Most Communist Soviets/Communes reached unofficial agreements with Japanese forces that the two would leave each other alone, or cooperate to take down independent and Guomindang-aligned guerilla units. The 'Hundred Regiments Offensive' launched at Mao's insistence in 1940 was the Red Army's one and only foray into actually fighting the IJA; though they managed to take several garrisons by surprise, the Japanese counterattack forced them back into the Yan'an Soviet with heavy casualties and Mao specifically forbade the Red Army from engaging the IJA from that point onward. Throughout the war the CCP focused exclusively on undermining the Guomindang and building up their forces for the Civil War. Knowing they had nothing to lose and everything to gain from saying as much, they made frequent claims to Allied reporters that the Guomindang was hopelessly corrupt, incompetent, focused solely on destroying them (the CCP), and doing nothing to fight the Japanese. They even tried to 're-invent' the characters used in traveling-actor-troupes to include characters like 'the corrupt GMD official' and 'the GMD soldier who always runs away and never fights the Japanese'. Needless to say the CCP had to make the inclusion of such characters compulsory for the troupes to actually adopt them, and the new characters never caught on outside the Soviets.
In the Civil War that followed the conclusion of the war with Japan, the CCP's policies of biding its time, avoiding combat, and building up its strength paid off. Although the GMD opened the war with an ostensibly highly-successful offensive in the summer of 1946, they had spread their forces far too thinly and the CCP was essentially able to melt into the countryside. The Soviets in the former-occupied-areas - particularly the north China plain - contributed in large to this success, as large Guomindang forces had to be committed to encircling and eliminating each Soviet, as their location meant they threatened Guomindang supply lines for the offensive in the north. In particular, Chiang's decision to attempt to eliminate the north-China plain Soviets, the Yan'an Soviet, and secure all of Manchuria at the same time was clearly a stretch too far; 500 000 i.e. half of his loyal troops were deployed to Manchuria in the '46 offensive, a France-sized area with no actual value (beyond the symbolic)note . To cut a long story short, the Red Army won the three-year, brutal and bitterly-contested Civil War for the CCP by using a well-thought-out strategy directed by military-paragon Lin Biao. Though their recruits were very 'green' relative to the Guomindang's grizzled veterans at the start of the war, Lin was able to compensate because The Red Army had a unified command-structure and clear chain of command, fighting as a single organisation; only half of the two million troops nominally under Guomindang control actually answered to Chiang or the Guomindang in anything but the loosest of senses, and factional rivalries meant that even the 'loyal' half often couldn't be counted on to stick to plans unless directly ordered to do things by Chiang... which brought all the problems normally associated with micro-management as Chiang's personal workload was more than any one man, or ten, could handle.