And I think this generalizes. War is basically a game of morale. Whoever's morale breaks first, loses - in both battles and wars. This is precisely why Afghanistan managed to defeat both the USSR and the USA. They will fight you to the very last man without even having a hint of morale issues. And then after they're all dead their children will do the exact same. And then their children's children. They simply will never surrender, and that makes them practically impossible to defeat. Iran is showing themselves capable of the exact same.
It's interesting to imagine a parallel WW2 where the Japanese emperor did not tell the war council to end the war, and they just continued to fight, as the council wanted. It seems that surely Japan would have lost, but the shape this would take when you have a people, and not just a leadership, unwilling to surrender is not at all clear.