The attack on the Soviet Union was a counter attack as Hitler had no other choice, Stalin was about to strike western Europe. Even if Germany had an army 5 times larger than that of the USSR, Germany was, due to its much smaller size than the USSR, in a strategic disadvantage, as the Red Army could have reached Berlin in less than a week through a surprise attack. Germany is smaller in size, hence less ground to defend, less ground to use as strategic advantage i.e. no where to retreat unlike the soviets who could have retreated within the vast landscapes of the USSR and reorganize to counterattack. Germany didn’t have strategic territory that the USSR had.Germany had a bigger industrial base than the USSR. Hitler knew that Germany must strike first and defeat the USSR by 1942. Therefore he did not order the German economy to be totally mobilized for war. It was a strategic mistake that cost, among other reasons, the war. The confidence in the defeat of the USSR was held not only by Germany but also by the British and Americans who didn’t give the Soviets a chance.
Germany was the world’s second largest industrial power (after the USSR). The Soviet Union had the third largest industrial base (about 70% of Germany’s size) while the British Empire had the fourth largest economy. Despite Germany being more powerful in terms of production capacity (about the same power as France and the Soviet Union combined) than the USSR during the first years of the war Germany’s war production was smaller than that of the USSR, since unlike the Soviets and the allies Germany’s war economy was not set to “total war” mode until 1943 i.e. too late. In 1944 Germany’s war production, despite allied bombings, was larger than that of the USSR and Britain and second only the the United States.