Stalin, due to the purging of his Generals, set back the timeframe for his offensive war to 1943.
His intention is signing the Non-Aggression Pact, was to bring war to the West, where the German, French and British armies would exhaust themselves, making it easy for the Red Army to swoop in.
Of course, France falling in six weeks was something he didn’t count on, and he had to know it was only a matter of time before Hitler went after him.
Hitler had a similar time frame.
Stalin’s purges of his officer corps and the Red Army’s poor performance in the Winter War with Finland convinced the Nazi dictator that Russia was ripe for the pickings.
Hitler thought if he moved up the offensive, he could finish off the Soviet Union before its posed a threat.
All he did was replicate Napoleon’s failure in 1812. Of course, the Soviet Union posed no real threat to Germany but Hitler could never be content in living in peace with his largest neighbor and supplier - you heard that right - the Russians supplied with raw materials and good right up to June 22, 1941.