Before starting the First World War, Germany in preparation of the war set up a strict rule not to invade Russia. If it ever has to intrude on any of the Russian lands, it will be confined to Ukraine. Germany needed Ukrainian land, not the Russian. Fortunately, the rule was not broken until the end of the war.
Hitler's slogan in the 1930s was the "survival of Germany." He argued that the nation needed a bigger land to survive. Hitler blatantly pointed the Eastern European countries including Poland, Czech and Romania as its targets and said he was willing to wage a war against Russia if he had to. In 1938, Nazi Germany annexed Czechoslovakia. Germany abandoned the Treaty of Versailles and rearmed itself, becoming the strongest power in Europe. The French armed forces admitted that their German counterpart is stronger and that they could defend themselves from the Germans but might not launch an attack against them. On top of that, the United Kingdom and France were still mired in the nightmare of World War I that caused some ten million casualties.
The Soviet Union stood out at that moment. It fought together with the Allied powers against Germany during World War I. Hitler targeted Poland after occupying Czechoslovakia. And for the Soviet Union, Ukraine may be at risk if Poland was to be seized by Germany which has been fixing its eye on the Ukrainian land since the First World War. Hitler had been insisting that exterminating Marxists was one of Nazi duties.
Aware of such threat, Poland had signed a mutual defense treaty with the Soviet Union. British and French delegations flew to Moscow, aiming to discourage Hitler's ambition. It was an irresistible proposal considering the circumstances, but Stalin was not so enthusiastic about the idea. It turns out that the USSR had another option to keep Ukraine: splitting Poland with Germany. So was born the secret German-Soviet Nonaggression Pact. Nazi Germany and the Soviet Union invaded Poland and divided it in half while Great Britain and France pretended making counterefforts.
As the war in Ukraine hits an impasse, Russia began threatening Germany, which is highly dependent on its energy supplies. Will the two shake hands again? Although it is unlikely this time around, no one can be sure who would betray whom and when. Or maybe in international politics, a concept such as betrayal does not exist.