Napoleon arguably understood the principles of war much better than any commander before him. And he developed principles of his own gained by experience. His later mistakes, post-1807, were usually the result of ignoring or violating his own principles.
There are two good examples of this. First, not returning to Spain to finish what he had begun after having to leave to confront Austria in 1809 which was the greater threat.
Second, at the beginning of 1813 Napoleon was urged by his subordinates, especially Berthier, to withdraw half of the troops from Spain to confront the Russians and Prussians in central Europe. Central Europe was the critical theater, not Spain, and a decisive defeat of the allies, especially before Austria decided to intervene, would have changed the entire strategic picture in Europe and allowed a reevaluation of the situation in Spain.