Upvote:5
By 1940, Japan had gotten most of what it wanted from China. It had obtained Manchuria in 1931, and the industrialized northeast corridor of China, between Beijing and Shanghai in 1937, and most of the remaining industrial belt along the Yangtze River, up to Wuhan, by 1938. In the following two years, Japan occupied the ports, and most of the coast of South China. If anything, the Japanese were "overcommited" in China (relative to its resources), and even more so after it went to war with the United States, following Pearl Harbor.
In fleeing from both the Nationalists and Japanese, the Communist occupied the most desolate parts of the country (apart from Tibet and Sinkiang), in the northwest. That was the Chinese equivalent of say, Montana and the badlands of the Dakotas. That part of China had little strategic value to Japan.
In 1944, Japan did launch the Ichigo Offensive in southwest China, in order to secure a line of retreat for troops being forced out of Myanmar ((Burma), but unless Japan planned to fight the Soviet Union in Siberia (it didn't), "Communist China" had no such strategic value. Nor did the Communists have much stomach for fighting Japan after the failure of their 100 Regiments Offensive in 1940.
Upvote:12
Remoteness
Shaanxi is very remote, in the deep interior of China, which is hard to fight in. The Japanese never attacked Chongqing either. (Chongqing was bombed, but so was Yan'an.) Progress into this region was halted due to Chinese victories such as Wuyuan.
The CCP were not as big of a threat
The CCP started the war with a very weak base, and even at the end of the war, they were a fraction of the strength of the Nationalists. In this situation, it is better to attack the stronger of the two enemies. There was a brief flare-up during the Hundred Regiments Offensive and the subsequent Three Alls Policy, but for the most part there was a stalemate between CCP and Japan.
Subduing China was not a priority
Japan's WWII aggressions were opportunistic in nature. Initially they thought that China could be subdued by taking its capitals, or by winning a decisive battle. That didn't work: Nanking and Wuhan were taken but the Nationalists didn't capitulate, and they also managed to preserve their troops through the war. Instead, Japan focused on South East Asia and the Pacific Theatre.
Lack of resources by Japan
By the latter half of the war, there was in fact a plan to invade the wartime capitals of both the Nationalists and CCP. This plan was frustrated by their lack of resources (due to the deteriorating Pacific War) and the increasing success of attacks by the "Flying Tigers" and its impact on daytime troop movement. The plan was finally shelved in favour of Operation Ichi-Go - the forces gathered in North China originally intended for the plan were redirected to Ichi-Go instead.
Game theory
The Chinese Theatre was a typical truel, in which the best strategy for the stronger two sides is to eliminate each other first, and for the weakest side to sit out until they are left head-to-head with the survivor. This is indeed what happened. This reason isn't historical, but it is food for thought nonetheless.