Nazi’s and SU signed a Non-Aggression pact. Hitler invaded Poland Stalin invaded: Finland, Poland and Baltic States.
The “friendship” ended 22 June 1941: Germany invaded the SU. (= Operation Barbarossa) Stalin was unprepared. He was warned by a spy, but didn’t believe it. He trusted Hitler.
Hitler thought he was winning in the West, because only Britain was fighting, the others had given up. This had always been his plan!
Napoleon had the same war 100 years earlier. Napoleon also decided to leave Britain and attack Russia. Napoleon also lost, because of the Russian Winter. Apparently Hitler thought he was better than Napoleon. Hitler lost too!