A center piece of Hitler's political popularity was his promise to re-claim all German territory lost after World War One.
Danzig was an independent and predominately German city on the Baltic Sea coast, surrounded by sovereign Polish territory.
Hitler demanded a neutral land link between Danzig and the German border, and Poland refused.
Poland and Russia had territorial disputes going back at least 600 years, so when Hitler agreed to let Russia occupy eastern Poland, World War 2 was on.
It is likely that Stalin's completely inept decision to attack Finland, immediately after seizing Poland, also convinced Hitler that Russia could be decisively beaten by the German Army.
Kick in the door……