system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: What lead to Japan and Germany becoming allies in WW2?
gpt
It was an alliance of convenience. The more natural friendship was actually between Germany and China; both countries rejected the Treaty of Versailles, and there was much German investment in China. 

Hitler correctly perceived Japan as a valuable ally against Britain, and given the recent conflict between Japan and the USSR on the borders of Manchuria, hoped that he could use Japan to threaten the Soviet Union in the east, drawing away forces that might be used against his invasion in the west. As a major naval power, Japan could project power in the Pacific in a way that Germany or Italy had no hope of doing. Since Japan was interested in conquering China, this caused a foreign policy pivot from China to Japan.

With Japan having their eyes set on British colonies, the Dutch East Indies and French Indochina, Germany was also a natural fit--the Germans would take on these countries in Europe, paving the way for Japan in the Pacific. Moreover, since the Japanese were outnumbered by the USSR in Manchuria, a German invasion of Russia would reduce the threat to Japan. The Japanese ended up signing a non-aggression pact with the Soviets, and the Soviets funded the Chinese war against Japan, spoiling Japan's value as an ally against Russia.