Any history buffs on here, with knowledge about the mix of countries that aligned against the U. S during WW2?

Watched a film on Netflix, Called Sea Battles' (I believe correct?) based on WW1 and WW2. Never really understood why Japan ever entered into some sort of a pact with Germany since during WW1, they were bitter enemies, and Japan declared war on Germany ?

The two countries could not be more different in culture, life styles, etc, and yet we were fighting both of them, in the Pacific and the Atlantic along with Britain.

Anyone know any more about what kind of pact that Japan/Germany had that had almost the rest of the planet fighting them?

Any history buffs on here, with knowledge about the mix of countries that aligned against the U. S during WW2?
Post Opinion