With all due respect to the soldiers who bravely fought against the German Wermacht near Moscow in November-December 1941, the German retreat was hardly a miracle. The Wermacht was completely unprepared to fight in winter, at temperatures below -20 degrees Celcius. They had no winter clothes, and their engines froze, making their armored vehicles useless. The reasons for this strange lack of preparation were very complex, but I might only mention one factor: the German strategists planned to capture Kyiv (a.k.a. Kiev) "on the march," not later than by mid-July of 1941 (Zhytomyr was captured in early July), while in fact Kyiv resisted till September 6 and swallowed a huge chunk of the German resources.
Also, your statement that the Germans "ran all the way to Berlin" may create an impression that they retreated from Moscow all the way to Berlin in a short time. In fact, in December 1941, they retreated merely to the eastern Ukrainian border, to the Mykhailivs'kyj hamlet - Bakhmach - Konotop line. In late winter and early spring 1942, the Soviet Army made three attempts to develop its offensive toward Kharkiv, and each time it was defeated, with an immense slaughter of hundreds of thousands of its soldiers by the Germans. In spring 1942, the Soviet Army also made an attempt to take the Crimea, and its operation, led by infamous Mekhlis (about whom Stalin said, "for this purpose, we don't need an intelligent man, let's have Mekhlis do it"), resulted in the waste of hundreds of thousands on the Soviet soldiers' lives, and no success whatsoever.
The defeat of the Wermacht in 1943-1945 was a combined effort of the Allied Forces - not any miracle. Plus, there was a colossal effort of the Ukrainian Insurgent Army, whose role in WWII still remains to be fully appreciated.