and Finland too.
They invade Poland, Latvia, Estonia, Lithuania, and Finland...but they were not the aggressors?
The battle of Britain failed and Hitler had no sea lift capacity to mount an invasion of the British Isles (let alone stand up to the British Navy.) Stalin's invasions in Eastern Europe went too far, and at that point the opportunists fell out because Hitler could go no further than the English Channel.
Both Dictators understood clearly that at some point the Nazis would turn East -- or that the Soviets would press further West. Stalin decided that he would get more territory by playing for time with Hitler, and get nothing but a defensive alliance by bargaining with the West. The Russian People paid as dearly for Stalin's duplicity and bad faith as the Germans did for Hitler's.