Why did the Japanese ally with Germany in ww2, who was a country that wanted white supremacy on a global scale?

by NoBiasBtw
Lubyak

There are a few key reasons why Japan allied with German in the lead up to World War II. The primary one was to try and deter a U.S. intervention in the Pacific, with a secondary goal of ensuring that Japan could capitalise on Germany's victories in Europe by taking control of European colonies in Asia. Of course, that's the quick version of the answer, and there's much more we can drill down on. So let's do that to try and understand what Japan hoped to gain out of an alliance with Germany.

German-Japanese Relations Before the Alliance

"...it would shame me more to surrender Tsingtao to the Japanese than Berlin to the Russians."

Kaiser Wilhelm II

Prior to World War I, the Germans and Japanese had relatively poor relations with each other. Indeed, during World War I itself, the Japanese were allied with the United Kingdom, and seized German colonial holdings throughout the Pacific and East Asia, while the Imperial Japanese Navy and its modern fleet of dreadnoughts and battlecruisers helped to ensure the German East Asia Squadron would have to leave East Asian waters. However, Japanese-German enmity had existed before this. In the aftermath of the First Sino-Japanese War in 1895, the Germans had joined with the French and Russians in forcing Japan to yield the Liaodong Peninsula that the latter had received at the end of the war, opening up the opportunity to secure a concession over Dalian (more commonly known as Port Arthur). A few years later, German in turn forced a concession of its own at the port of Tsingtao on the Shandong Peninsula. The Japanese in turn found these moves by the Germans to be a clear demonstration of Western hypocrisy, as it appeared to Tokyo that the Germans were unwilling to grant Japan the fruit of its victories over the Qing Empire. Similarly, Kaiser Wilhelm II was apparently an enthusiastic believe in the racist theory of the "Yellow Peril", and saw Japan as the vanguard of this threat to white supremacy. Suffice it to say, relations between Japan and Imperial Germany were far from cordial.

Similarly, German-Japanese remained cool during the post-war Weimar years and the early years of the Nazi regime. Notably, Germany was a prominent partner of Chiang Kai-shek's Nationalist government in the late 1920s through to the outbreak of the Second Sino-Japanese War in 1937. German firms were major investors in the development of Chinese industry and infrastructure, and the German military mission to China would provide Chiang with a core of German trained divisions that would go on to inflict heavy casualties on the Japanese during the Battle of Shanghai.

As evident, even into the 1930s, Germany and Japan were closer to rivals than partners, especially over China, where Japan asserted a special--and exclusive--interest. Given all of this, it is rather surprising that the two powers would end up as major partners. However, the path to this alliance would remain difficult, and unclear how it would ultimately unfold.

Anti-Comintern Pact and Betrayal

The first area of co-operation between Germany and Japan that would culminate in the Tripartite Pact was the Anti-Comintern Pact, signed in 1936. The Anti-Comintern Pact, as one might suspect, was anti-communist in nature, and--from Japan's perspective at least--was to be able to threaten the Soviets with the prospect of simultaneous war against Germany in the West and Japan in the East. Indeed, the Soviets grew very concerned that the Anti-Comintern Pact was a prelude to an invasion from both East And West. However, in the summer of 1937 the Marco Polo Bridge Incident pushed the Japanese into an expansive war in China, that absorbed substantial portions of the Imperial Japanese Army's resources, which dramatically changed Japan's posture in Manchuria. Now the concern was very much in deterring a potential Soviet attack while the Japanese were tied down in China. Negotiations to expand the Anti-Comintern Pact into a wider military alliance continued, but the Japanese were determined to make the Pact into an explicit anti-Soviet alliance, which ultimately resulted in the Germans and Italians signing the Pact of Steel in May 1939, without Japan. This resulted in what would come to be a low-point in German-Japanese relations in the 1930s: the Molotov-Ribbentrop Pact.

The Molotov-Ribbentrop Pact, signed in August 1939 came as a shock to policy makers in Tokyo, who saw it as a breach of the Anti-Comintern Pact. Even more worryingly, the news of the Nazi-Soviet agreement came at the same time as Japanese forces in Manchuria had taken a stunning setback at the Nomonhan Incident, where Soviet forces under a promising general named Georgy Zhukov defeated the better part of a Japanese division that marked the high point of a series of border clashes between the Japanese and the Germans. The shock was enough that it brought about the resignation of then Prime Minister Hiranuma Kiichirō and seemed to render the Germans very untrustworthy in the halls of power in Tokyo.

Towards the Tripartite Pact

The outbreak of war in Europe in 1939 prompted major changes in the global political scene, especially in 1940, when German forces overran the homelands of France and the Netherlands, each of which had large colonial holdings in East Asia that were key area for Japanese conquest. To Tokyo, this presented both an opportunity and a threat. On the one hand, the German occupation of their homelands meant that the French and Dutch colonies in Asia were vulnerable to Japanese pressure and even occupation. However, there was also concern that--given Germany had broken with Japan with the Molotov-Ribbentrop Pact--that Germany might have its own interest in the region. This fed into a wider feeling within Japanese policy makers that Japan was facing a key opportunity that it had to seize now, lest Japan "miss the bus". This concern made the potential for an alliance with Germany even more prominent with Japanese policy making.

However, while the need to come to an understanding with Germany over the future of the European colonies was important, as important--if not more--was the hope that the Tripartite Pact would serve as a deterrent to the potential for conflict with the United States. Relations between Washington and Tokyo had been trending downward for sometime, especially over Japan's increasingly aggressive behavior in the Pacific. The U.S. wanted to try and avoid a conflict with Japan and so sought to use economic pressure to limit Japanese expansionism through measures short of war, with German seeming to be a more prominent or existential threat. In that respect, the alliance with Germany had a significant advantage in that if the United States wanted to intervene against Japan directly, it would force the United States into war on two fronts, the exact situation U.S. Pacific policy was attempting to avoid. Japanese leadership hoped that this threat would serve to convince the United States to adopt a more conciliatory tone in negotiations over the future of the U.S.-Japan relationship.

As a side note, it's worth noting that despite the formal alliance between Germany and Japan, the Soviets managed to avoid the spectre of a two front war. The Tripartite Pact explicitly included text that excluded any change in any signatory's relationships with the Soviet Union, and Japan was quick to follow up the Tripartite Pact with the Japanese-Soviet Non-Agression Pact. While the Japanese did consider taking advantage of the German invasion, once it became clear that the Soviet Union would be able to weather the initial strike, the Japanese were more than happy to accept the security that the German-Soviet struggle gave to their northern flank.

TL;DR It's important to note that the alliance between Germany and Japan was not necessarily ideologically focused. Rather, it was one of convenience. From an IR theory perspective, both powers were revisionist powers, seeking to overthrow the global system dominated by the United States and United Kingdom, and in that respect they were natural allies. However, while there was a degree of Germanophilia in Japan over the apparent successes Germany had in Europe, this favorable reputation was not the bedrock of the alliance. Rather, the bedrock was simultaneously a desire to take advantage of German victories in Europe, while also presenting a deterrent to the United States.

I hope this has helped to answer your question, and please feel free to ask any follow ups.