Hitler and Napoleon had simultaneously very similar and very different situations to deal with. Both had conquered most of Europe or at least subdued it, and were sure of victory when attacking Russia/the USSR.
They were severely different in the form of warfare they used and military tactics however. Napoleon’s plan was to destroy the Russian army in one big battle, capture Moscow, and wait for the Russian surrender. Hitler on the other hand, had several opportunities within the first couple of months of his invasion to attack Moscow but didn’t, opting instead to siege Leningrad and capture Kiev.
Napoleon lost because even though he captured Moscow, he wasn’t able to break the Russian army (the battle of Borodino was considered a partial loss by both sides), and was unable to sustain his enormous army deep in Russia with dwindling supplies, behind vast Russian territory that was uncaptured and held by Russian troops. Hitler, trying not to commit that mistake, was eager to 1) get every inch of land he could on his flanks before attacking Moscow and 2) getting as many resources as possible to sustain his army so far into the soviet heartland. Logically, both of these decisions made sense at the time, but in hindsight, the time he spent doing this before attacking Moscow allowed Russian reinforcements to arrive to defend the city. With the survival of Moscow survived the Soviet government and the will to fight. After his failed operation typhoon, hitler decided to focus on resources and attack the caucuses, again diverting his troops. The length and minimal gains in the war after the initial invasion soon began to take a toll on the slowly dwindling German army (with other axis troops). While the Germans had to bring inexperience troops from the rear, the Russians were able to hold a partisan war behind enemy lines and had an immense amount of manpower.
As for industry, at the time of the invasion, the Germans were rightfully confident in their technical superiority because Russian technology and defenses were outdated. But due to the movement of Russian industry to last the Ural Mountains and aid from the US and UK, Soviet industry soon caught up to German levels, leaving the battles up to number of troops and the quality of the commanding generals.
In short, Hitler did learn his lesson from Napoleon and tried his best to overcome the challenges that Napoleon had faced, but simultaneously faced new unforeseen challenges that still caused the eventual collapse of his large military machine.