The way I understand it, the soviets were getting their shit pushed in throughout most of the western portion of their landmass for the first year or so of the invasion. Was it just the winter proving too formidable for an underprepared German army, some changes made within the Red army, or other factors?
Thanks.
There are a number of factors that lead to the Soviet Union "turning the tables"
The German offensive began to loose steam as it neared Moscow. A combination of harsh winter conditions, stout Russian defense, and infighting between Hitler and his generals led to the floundering German offensive. As the Germans were nearing Moscow, most of the German high command felt that all resources should be transferred to Army group center under Fedor Von Bock who would than strike at Moscow. Hitler however, wanted to divert resources south to attack Kiev since he was confident that the Soviet Union would collapse by mid 1942 at the latest and he wanted to secure the abundant resources in western Russia like Oil, grain, etc... Badly needed reinforcements were also sent to army group north to help take Leningrad. Nobody dare challenge Hitler, especially after the victories at the Munich conference and in France, so the reinforcements were sent to army group south to subjugate the Ukraine. It was not until October that Von Bock got the men he needed and by that time the Soviets had reinforced with troops from Manchuria and Stalin had appointed Zhukov as defender of Moscow, also the roads had turned into mud because of torrential rain. The German generals wanted to retreat in the face of harsh Soviet counter attacks, but Hitler refused, eventually Heinz Guderian disobeyed and began a retreat, which would cost him his job. Even though it looked successful the opening stages of Operation Barborossa were a failure. Only Army Group South got anywhere close to completing its objectives, the center group couldn't capture Moscow and the Northern group was unable to capture Leningrad. So the Germans weren't in nearly as good a situation as it would have appeared.
On the Soviet side Stalin took a step back from his overbearing ways (the opposite of what Hitler did) he allowed his generals more freedom and began to ease off his troops saying that "persuasion, not violence should be used to motivate the troops". The Soviets also got over the initial shock of the attack and began to reorganize themselves, there armament factories that had been moved to Siberia began to rapidly produce arms, vehicles, etc. at a far greater rate than the Germans could, they also were able to call upon more reinforcements, the Germans suffered horrendous losses in the Polish, French, and opening stages of Barbarossa and these losses were getting harder to replace. The Germans had suffered 213,000 casualties by July of 1941 and by the start of August 10% of the invasion force was dead or wounded. The Soviets also had huge advantges in resources like Oil and were able to focus nearly all efforts on the Eastern Front where as the Germans had to divert men to partisan operations and to other fronts like North Africa.
Sources:
The Third Reich at War by: Richard J. Evans
The Second World War by: John Keegan
I just want to amend /u/Warband14 answer with some details:
One overlooked factor was total mobilization of USSR to a single purpose. It includes not only military draft, but industry and agriculture as well. Many military factories (not all, of course) from Ukraine, Byelorussia, Baltic escaped blitz and were successfully evacuated to safe places (mostly by railroads), far away from front lines - Ural, Siberia, Middle Asia. Then in very short time USSR quickly ramped up production back and even over pre-war levels - so in the war of attrition Wehrmacht started to loose, as military production all but stopped in 1941-42 and then Germany started to lag in replacing material and human losses at front lines.
On the Soviet side Stalin took a step back from his overbearing ways
Per Molotov's interview with writer Ivan Stadnyuk during work on the book "War" (unfinished)
(~translation)
This happened after tough shouting match with Zhukov, on June 29th, 1941. Stalin started to swear, calling Timoshenko, Zhukov and Vatutin derogatory names. Timoshenko and Zhukov started to answer and in the end white-lipped Zhukov mentioned Stalin's mother and requested Stalin to leave the cabinet and not meddle into military decision making. Amazed Beria tried to intervene on behalf of Stalin, but Stalin left the cabinet without saying a word.
(quote on russian) Ссора вспыхнула тяжелейшая, с матерщиной и угрозами. Сталин материл Тимошенко, Жукова и Ватутина, обзывал их бездарями, ничтожествами, ротными писаришками, портяночниками…. Тимошенко с Жуковым тоже наговорили сгоряча немало оскорбительного в адрес вождя. Кончилось тем, что побелевший Жуков послал Сталина по матушке и потребовал немедленно покинуть кабинет и не мешать им изучать обстановку и принимать решения. Изумлённый такой наглостью военных, Берия пытался вступиться за вождя, но Сталин, ни с кем не попрощавшись, направился к выходу.
After this incident, Stalin never intervened into details of military planning and was rather polite with top brass. He also quickly realized that generals are finite resource and cannot be quickly replaced. With some unfortunate exceptions (Pavlov and some division-level commanders of Western Front, after loss of Kiev), none of high-level commanders was shot for losses and encirclements of 1941. Many were demoted and most rose back in ranks.
Sources
(JSTOR) Mark Harrison - The Economics of World War II: Six Great Powers in International Comparison
(russian, online book) Stadnyuk I. - War = Стаднюк И.Ф. Война. — М.: Воениздат, 1987. Ivan Stadnyuk attempted to write an epic book, covering whole war in Eastern front and based on documents, but got only to July of 1941. 3 volumes.