As the title says, I would like to know why was the german offensive so successful in the first stages of opeartion barbarossa. Were the soviets not expecting an attack or was the red army simply too weak to stop them at first? What changed when they finally halted the offensive?
The initial success has a number of factors. For one, the Great Purge took out a huge proportion of the most senior staff- Marshalls, Corps commanders, admirals, etc. While not all were killed, and some were eventually "rehabilitated", this meant the initial defense against the strongest fascist push fell on an army in disarray, with commanders who were inexperienced and or terrified of taking any action without political approval.
Another issue was the border fortifications. The "Stalin line" was a huge system of forts and gun positions along the Western border as it stood before the molotov-ribbentrop pact. After the pact and the partition of Poland, the plan was to build a new system on the new border. The guns were mothballed, maintenance ceased, garrison troops and supplies were shuffled around, etc. But the invasion came in before the new fortifications were in any way ready. So instead of one or both defensive lines being ready, 0 were.
Third, logistics were a hot mess. The equipment of the red army was in a transition period, with a vast number of outdated tanks, small arms and cannons being phased out in favor of new ones. When the invasion came, units might find themselves with their old equipment, but no ammo or fuel because they were supposed to be replaced with the new stuff. Or they had hundreds of brand-new KV and T-34 tanks, but the shells for the main guns were still thousands of miles behind the front in a supply depot somewhere. There are numerous isolated incidents of these new tanks absolutely dunking on the fascists when they could be brought into action (http://tankarchives.blogspot.com/2013/03/battle-of-raseiniai.html?m=1), but this was a battle of millions, and the majority of the new tanks were idle or squandered.
As for why it failed.. Well. The short version is that the wehrmacht didn't have enough fuel, equipment, men, transportation or food for a multi-axis attack with supply chains that were thousands of miles long. It's nearly 2,000km from Berlin to Moscow. It'd be quite a feat to get a few million men there in peacetime. They didn't have the equipment because they didn't have the resources or the workers. They didn't have the soldiers because they'd already called everyone up. So when Nazi officials said it would be a short campaign and the soviets would collapse in a month or two, that was part hope, and part necessity. Because if anything other than a crushing victory before winter 1941 happened, Nazi Germany was doomed. They'd spent 8 years robbing Peter to pay Paul, meaning they lurched from one crisis to another. Hitler's plans from 1938 on were basically "step one- invade. Step 2-??? Step 3- everyone surrenders and the thousand-year-Reich prospers." Unfortunately for them, and fortunately for the rest of the world, the bill came due.
Sources:
"Russia's War: a history of the soviet effort", Richard Overy
"The Wages of Destruction", Adam Tooze