Ending a fight as soon as you're sure who would win would mean ending almost all fights before they begin. The PCs win 99% of combats in D&D. That being said, there is nothing wrong with ending a fight with a surrender, someoneone fleeing, or just fading to black and saying the monsters are dead.
The second comment is more in line with the stronger solution. The solution I try to use is: Always try to have something meaningful on the line during every round of combat. If the PCs are fighting a scout group of enemies, and the PCs are clearly winning, the battle might shift to trying to prevent any of the enemies from escaping to report back. If th PCs are are fighting a giant crab in a bubble in an underground boiling lake, the PCs may have to contend with keeping the dying creature from popping the bubble and boiling everyone. If the PCs are fighting an insane telepathic creature beneath a bridge in a bandit lair, the creature might barter with them by promising to reveal secrets of the bandits. This is not always possible, but just ask yourself how to keep the fight tense in a way that supports the story.