The spread of totalitarianism before World War II gave rise to the creation of alliances.
On one hand, the totalitarian states: nazi Germany, Japanese Empire and fascist Italy consituted the Axis powers, and decided to collaborate so that each of them could fulfill their expansion and dominance objectives.
On the other hands, the Allied powers emerged to resist and counterattack the aggressions that the totalitarian states were committing. This alliance was integrated by France and UK at first, and during the conflict (WWII) both the US and URSS ended up joining them.