there has to be a level of competence in any army that can mobilize 1.4million men in such an amazing offensive across such a large swathe of Europe so I'm curious what were the reasons behind the failure of Barbarossa?
there has to be a level of competence in any army that can mobilize 1.4million men
First of all what do you mean by this? The German army invading Russia numbered closer to 3.5 million men, and they actually outnumbered the Russians during 1941. (The Russian army was actually larger overall but they had less men than the Germans did on their western border.)
As for the failure, well, there are a lot of reasons.
First of all lets look at the German plan.
Operation Barbarossa was to be the largest military invasion ever conducted. The Germans planned to send their 3.5 million men army into Russia to destroy what was at the time the largest military in the world. To do this they planned to invade on a broad front of more than 1800 miles, and expected to penetrate more than 1000 miles into Russian territory. To do this they planned to attack along three strategic axis, one towards Leningrad, one towards Moscow, and a third towards Ukraine and the Don river bend using three army groups, North, Center, and South.
The plan expected to have crushed the Soviet army within the first six to eight weeks, and then everything after that would mostly involved mop up and the capturing of major cities by mobile units.
They underestimated a number of things however.
First, they underestimated the Russian's ability to replace their losses. Russia's population was huge, and despite being in the middle of a major reorganization orchestrated by the competent though seemingly unlucky General Timoshenko, they were able to effectively mobilize vast quantities of troops to help blunt the German attack. In June 1941 alone the Soviets mobilized more than 800,000 men, and another 600,000 the next month. In fact, by December 1941 the Russian army was actually larger than it had been at the beginning of the war despite taking nearly 5,000,000 casualties.
The Germans took around 800,000 casualties themselves, but between those casualties and the significant material losses that went along with them, the Germans army was less capable of replacing its losses, and when the next summer rolled around it was no longer capable of making another broad front attack and had to settle on an attack in the south.
Next, they underestimated the stubbornness of the Russians. Hitler famously said about Russia that, "We have only to kick in the door and the whole rotten structure will come crashing down." But that wasn't what ended up happening. The Russian forces made numerous ferocious, though ill-fated, counter-attacks that consumed both time and materiel that the Germans simply couldn't afford. A perfect example of that is the Soviet attacks around Dubno in late June in which the Germans lost around 200 tanks. The Russian forces were crushed, but the Germans needed every tank they could get. Further, when Russian forces were surrounded they quite often needed to be forcibly subdued, which meant that large portions of German forces were devoted to reducing pockets instead of attacking.
The Germans also misevaluated the state of Russian infrastructure. Russia's infrastructure was much less developed than Western Europe's had been, and the huge army was that now charging into Russia put a massive strain on an already underdeveloped system. It was not unusual for Panzer Divisions to have to wait a few days because they didn't have the fuel to effectively advance any farther. Combine that with the fact that much of the German logistical train relied on horses, meant that even when things were moving smoothly, they weren't always going to keep up with the fast moving mobile divisions. Even more importantly as the Germans moved farther and farther into Russia they moved farther and farther away from their bases of supply while the Russians got closer and closer to theirs. Also, the rail system which the Germans expected to rely on to quickly move supplies to the front used a different gauge than German trains, and while the Germans knew this, it would still take time to switch the tracks to the proper gauge.
So all these things combined to slow down the Germans invasion, which then allowed it to be effected by the bad weather in the fall. I am not talking about the winter, I am talking about mud. Starting in late September heavy rains turned the predominantly dirt roads in Russia into mud. This further complicated the logistical situation because as you can probably imagine, mud tends to slow down road traffic. This once again prevented front line units from getting the supplies they needed and slowed down the attacks on Moscow. Actually, in late October and early November when the ground began to freeze it was actually a good thing in a way for the Germans, because it meant that they could really be more mobile again, and November saw the attacks on Moscow renewed to an extent. But by early December the Germans were at the end of their rope, and the Soviet counterattacks around Moscow put an end to Barbarossa.
Other things are also blamed for the failure, for instance a good portion of Army Group Center's tank strength was diverted south to complete the massive encirclement around Kiev, and the approach to Leningrad was bungled, but who knows what would have happened if those things would have gone differently.
In the end Barbarossa, while certainly impressive, failed at all three of the goals it set out to accomplish. The Germans failed to destroy the Soviet army, they failed to take Moscow, and they failed to take Leningrad. The Germans underestimated their enemies, they overestimated the condition of Russian infrastructure, and in the end they simply didn't have the men to continue their offensive.
Oh and one other thing that didn't help them was the way the Wehrmacht treated the people they conquered. Genocide was the name of the game when the Germans entered Russia, and as you can imagine they didn't win any hearts and minds in the east.
So yeah, I sort of painted the campaign in broad strokes, but I hope I gave you an idea as to why Barbarossa failed.
For further reading I suggest you take a look at Before Stalingrad by David Glantz, who is one of the preeminent english language Eastern Front scholars.