Part of the problem is incorrect assessments of the balance of power, combined with stubbornness. Both the Germans and the Japanese assessed that their martial spirit would enable them to overcome their industrially-superior adversaries. Both were wrong. Also militaries the world over have a culture of stoicism under conditions of adversity. At the tactical level it sometimes means you can turn around what appears to be an unwinnable situation. I'd have to dig to see where this has reliably worked at the strategic level. My initial thought is "it doesn't, but military officers who have spent their entire adult lives inculcated to act otherwise will never acknowledge that".
Look at some of the ridiculous propaganda that was written at the start of Ukraine's 2023 summer offensive: https://www.telegraph.co.uk/news/2023/06/09/british-made-tan...
There's been interviews where Ukrainian troops said "we thought the Russians would just run away after the first day of seeing our Leopards".
Both sides in this conflict have underestimated each other in different ways, but industrial attritional warfare is the great equalizer: it doesn't matter what men THINK will lead to victory if enough steel is thrown in the other guy's direction to remove all subjectivity.