I'll do the aside as a warmup to the main point: Soviet foreign minister Vyacheslav Molotov gave his name most famously to a bottle of gasoline with a rag wick in the top for use as an improvised incendiary device. "Molotov" was a nom de guerre based on the Russian word for "hammer" -- as in, "Hammer and Sickle". But the name of the incendiary device was created by the "counter-revolutionary" Finns. Russian cluster bombs dropped on the Finns were called "Molotov's bread baskets" by the people on the receiving end. In response they gave back (notably to open Soviet tank turrets) a little home-made burn-baby-burn, calling them "Molotov cocktails".
Anyway. It was on this day in 1939 that Soviet Russia and Nazi (National Socialist Workers' Party) Germany came to a nonaggression agreement that came to be named after its chief negotiators, Vyacheslav Molotov and Joachim von Ribbentrop: the Molotov-Ribbentrop Pact.
Things were a bit complex for the Axis at that time, since German ally Japan was engaging in an undeclared war with Russia. Further, Germany had eyes for Poland, and did not want Stalin to interfere there. Put simply, under the terms of the pact the Soviets were free to turn their back on Europe long enough to stop Japan at the border of Mongolia, and the Nazis were free to expand into western Poland.
Smart Diplomacy! All the tyrants were or should have been relatively pleased: Japan got to keep Manchuria, Russia got to keep Mongolia, Germany got western Poland, and then Russia got eastern Poland.
Russia also got dibs on Finland, Estonia, Latvia, and part of Romania. Germany was supposed to get East Prussia and Lithuania, but Stalin got to Lithuania first. This is a historical example of the maxim, "Anybody who would go that far probably won't stop there."
On 22 June 1941, Hitler decided to invade Russia. And the rest, as they say, is World War II History.