The Soviet Union was a huge country, bigger than most people think. At the time, the USSR was the second largest empire behind the British. As far as world history, it was the third largest ever. By the way, the short lived Mongol Empire ranks as the second largest ever, and a big chunk of that got swallowed up by Russia.
The Soviet Union was rich in terms of manpower, materials and resources but the young nation (established 1922) was greatly underdeveloped in terms of being a modern industrial nation. In other words, she had the ingredients to be a self-sustaining superpower but had not taken full advantage of her potential.
Hitler knew this. Since Germany did not have the resources to be a self-sustaining nation, like the United States was, he figured he really needed to conquer Russia. And with their resources, he could take over the world. His original plan was to invade Poland and then, without stopping, take Russia. But as soon as his troops entered Poland, Britain and France declared war on him. Therefore, he had to put his Russia invasion on hold so he could contend with his western enemies.
Rather quickly, Hitler conquered just all of western Europe except Britain. The Battle of Britain ended up in a stalemate with Germany on one side of the Channel and Britain on the other. Knowing the British couldn't move on him either, he decided to take advantage of the stalemate and go back to his original plan. He invaded Russia.
Had Hitler been half as smart as he thought he was, he would have known that Russia can't be conquered by military force. Not by him or anyone. She's just too big.
King Charles XII of Sweden learned this the hard way in 1708-09. He was an outstanding general and believed he could take Russia with his superior army. Between the massive land size, the hard winter and the Russian people themselves, he got whipped.
About a hundred years later in 1812, Napoleon tried to take Russia. He read all about Sweden's attempt as it was well documented in books. So he did have twenty-twenty hindsight. But he figured the Swedish King wasn't as smart as he was and his army wasn't as good as his, so he invaded anyway. He didn't do any better than Sweden did.
Hitler and his generals were well aware of both of these attempts. But he figured both of these leaders weren't even half as smart as he was, nor did either of them have his modern technology (planes, tanks, etc). And seeing how he really needed to have these resources... he fooled himself into invading.
Hitler's invading forces were subdivided into three army groups, North, Centre and South. German Army Group North's objective was to take Leningrad (St Petersburg). German Army Group Centre's job was to take Moscow. German Army Group South was to take Stalingrad. By knowing what German Army Group was involved, following the events on the Eastern Front (aka the Russian Front) is much easier to follow. The Red Army also fought battles in Scandinavia and down south in places like Romania and Yugoslavia.
Had Germany been able to take these key Russian cities, they still would have lost the war. The Germans were never that close to winning it. Although the Eastern Front was extremely brutal and saw the highest casualties of the war, Hitler barely made a small dent in this massive empire. Stalin had moved many of his essential factories further east where he already had other factories. The massive land size, the hard winters and the large population beat Hitler's forces just like they did Napoleon and King Charles XII.
WWII forced the Soviets to take full advantage of their resources and expedite their development as an industrial nation. In the end, they emerged as a world superpower. Should someday another brilliant idiot try to conquer Russia... he will fail too.