I've heard it said that the relationship was more like an agreement to stay out each countries attempts to conquer and just simple trading, but that interpretation doesn't sit well with me. The Nazi's were obviously raging racists and at least at the very top wanted to dominate the whole planet, but admittedly mostly Europe. The Nazi's never even tried to have and maintain such a strong bond with any other nation, not even with white ones who were much more vital to winning the war, and as far as I know they never planned to betray Japan either. if Japan was successful in taking over the southeast Asia and especially China the Nazi's plans would always be impeded. The Nazi ideology should make all of this impossible but even behind closed doors their were high ranking Nazi's who gushed about how amazing the Japanese are, and since it was classified those words could not even be used for propaganda.
On the other hand The Japanese didn't care at all about The Nazi's goals and in fact must have known if Japan succeeded then the Nazi's would eventually have to turn of them, due to their stated ideology and goals. Since the Nazi's were almost completely focused on Europe I doubt they ever spent much of their military resources on the Japanese efforts, along with the colossal amount of resources Japan must have reaped from razing China, I don't understand their reasoning for the're relationship with the Nazi's either. They too behind closed doors had military members gushing about the Nazi's. So can somone please help me make sense of this? I realize I'm oversimplifying the details of all of this but honestly my post is already too long.
Short answer:
They didn't have "such a close relationship" -- they shared enemies.
Discussion:
You can compare with the United State and Britain's "alliance" with Stalin. We didn't actually share anything much politically with Stalin other than his enemies-- but that was enough. Very soon after the end of the Second World War, the tensions between the Soviet Union and the western democracies became a cold, and sometime hot, war.
The Japanese were suspicious of the Nazis' racism -- they had a sensitivity to racism from experiences with Europeans. That didn't stop them from contriving a bit of nonsense about the "Yamato race", but Hitler's world historical mission wasn't any part of Japan's conception.
The Japanese, as a militarized society, had a high regard for German military traditions-- the Meiji era Japanese army had been trained by German advisors, and they'd long seen eye to eye on the threat posed by Russia. Interestingly, during the First World War, when Japan was one of the Allies, that alliance wavered early, by 1915 there are communications between Japan and Germany about a possible peace, and by 1916 there are peace talks in Sweden. In the end, Japan used its talks with Germany as negotiating leverage in its position with Britain on post war spoils in Asia.
So there's a history of a familiarity with Germany, and the utility of German military power to advancing Japan's own goals, but there's no real identity of interests. There are some interesting moments of tension in the 1930s. The Germans, for example, had been military advisors to Chiang Kai-Shek's Nationalists in China; these are withdrawn by the Nazis. Similarly, there's an attempt by the Germans to mediate the conflict in China, an historical lacuna -- can't name many other efforts by the Nazis to mediate conflict! The Germans are hostile to Japanese motives in China, after the Marco Polo Bridge incident, we have a German diplomatic cable which lays out German thinking on Japanese policy, and it's not sympathetic:
Japanese attempts to base measures in China as fight against Communism on the Anti-Comintern Pact are devious. As already stated in telegram 140 the Pact has not the objective of fighting Bolshevism in the territory of third states. Rather, Japan's measures may be considered by us as being contrary to the Anti- Comintern Pact, because they obstruct the consolidation of China thus promoting the spread of Communism in China and, in the end, driving the Chinese into the arms of Russia
There's some strange irony that this is a very good reading of just what the ultimate effects of Japan's intervention in China would be!
Interestingly, Nazi policy and outreach to Japan doesn't come from the German Foreign Ministry, it comes from the Dienststelle Ribbentrop -- a kind of shadow Nazi diplomatic service run by Joachim Ribbentrop. He later becomes Foreign Minister, but in the mid-30s, the Foreign Ministry is still "professional", and the Nazis distrust it.
Sources:
Kim, Hoi-eun. “Made in Meiji Japan: German Expatriates, German-Educated Japanese Elites and the Construction of Germanness.” Geschichte Und Gesellschaft, vol. 41, no. 2, 2015, pp. 288–320.
Ikle, Frank W. “Japanese-German Peace Negotiations during World War I.” The American Historical Review, vol. 71, no. 1, 1965, pp. 62–76.
James T. C. Liu. “German Mediation in the Sino-Japanese War, 1937-38.” The Far Eastern Quarterly, vol. 8, no. 2, 1949, pp. 157–171.
Shimazu, Naoko. Japan, Race and Equality: The Racial Equality Proposal of 1919 Routledge:1998
Boyd, Carl. “The Berlin-Tokyo Axis and Japanese Military Initiative.” Modern Asian Studies, vol. 15, no. 2, 1981, pp. 311–338.
Hill, Leonidas E. “The Wilhelmstrasse in the Nazi Era.” Political Science Quarterly, vol. 82, no. 4, 1967, pp. 546–570.