The Molotov–Ribbentrop Pact is the short name of the non-aggression pact between Nazi Germany and the Soviet Union signed in August 1939. The longer, more official name is Treaty of Non-aggression between Germany and the Union of Soviet Socialist Republics. It was named after the two high ranking representatives from those nations, Soviet foreign minister Vyacheslav Molotov and German foreign minister Joachim von Ribbentrop. The term non-aggression on its own sounds nice until you understand that it just meant that they weren't going to be aggressive to each other while they invaded the nations around them. Barely a week later on September 1st, Germany invaded Poland on their eastern border while the Soviets waited until September 17th to invade them from the other side. They both went on to invade the nations of Finland, Estonia, Latvia, Lithuania and Romania splitting the land and resources into their respective spheres of influence. Only Finland was able to hold them off.
Under the Versailles Treaty after World War I, Poland was guaranteed access to the sea (the Baltic). So the city of Danzig was declared a free city under the auspice of the League of Nations. So this split Germany up with a small portion of the nation disconnected from the mainland (where Konigsberg is now). Not a good situation. The city had its own currency, stamps and national anthem. Germany wanted to build a highway connecting Konigsberg to the rest of Germany. When this did not happen, Germany demanded Danzig back. Poland, having recently signed the Anglo-Polish military alliance, pushed back believing that having England (and France) behind them, Germany wouldn't do anything about it. Hence, ... as it is said ... the rest is history.