Once the commander is killed no one is there to give orders. The army keeps following the last order indefinitely while it's enemy cuts it to pieces.
Destroying the army causes the commander to surrender.
Alternatively, destroying the commander causes his or her army to start fighting with implacable ferocity for the sake of avenging the martyr.
Subverted: The commander is killed, but the army continues fighting when they find out.
Double Subverted: The commander is killed, yet the army continues fighting when they find out. Later, however, the implications dawn on them and they surrender.
Parodied: Every time the commander comes close to dying, or even suffers a paper cut, all the soldiers in the army blatantly get ready to drop their weapons. In extreme cases, they'll do this even when they couldn't possibly see or know what the commander's doing.
Zig Zagged: The Hero kills the commander, which results in the army's surrender. But then the soldiers become suspicious of the other side and continue attacking anyway. They set up a new commander, who is killed, but continue fighting as if nothing had changed. Then their third commander is killed, and suddenly they start fighting harder before surrendering.
The commander is not killed.
Alternatively, the army, for whatever reason, doesn't surrender even when its commander is dead.
Enforced: Executive Meddling, and/or the authors: "We want a quick resolution to the plot, but which also stops the enemy army."
Lampshaded: A Genre Savvy Character: "Now, someone's going to try and kill the commander, right?" or "That's weird. One guy gets killed and suddenly everybody stops fighting?"
Invoked: A Genre Savvy Character puts forward the idea to his allies, and they plan an operation to put it into action.
Exploited: A Genre Savvy Character realises this and decides to try and profit from it. An example: The Starscream plots to seize power once the commander is dead, perhaps by using a third army to defeat the first two.
A Genre Savvy Character protects the commander from being killed.
Alternatively, the character tries to keep the information hidden from the army, or persuades them to continue battling when they do find out.
The Genre Savvy commander warns his army or his allies that the enemy may try this.
Alternatively, the commander debates with his lieutenant over whether to try this on the enemy or not.
Conversed: A fan of war films tells her friends about this strategy and how successful (or unsuccessful) it is.
Though the army surrenders, it wasn't an unanimous agreement and they become immediately divisive over whether to continue the battle or not.
Alternatively, the soldiers in the army are called out on being cowards enough to follow the commander in the first place. Or The Hero is plagued by the realisation that an army of people could be controlled so easily by one person.
Alternatively, the underlying issue that caused the war resurfaces and threatens to start another one.
The Hero begins diplomatic negotiations to resolve the issue peacefully and more directly.
Alternatively, The Hero realises that he has now learned what motivates people to do bad things for one person and resolves never to let it happen again.