A fight becomes a slog if it is tedious and/or frustrating, causing a lack of player engagement. This can be traced to a few factors outside of specific game mechanics, such as the vagaries of luck and underlying math of the system (which can definitely cause and contribute). I think we all agree that combats should be fun and exhilarating, so it's up to the DM to do whatever's necessary to get everything on a one-way trip to Awesome Town as soon as possible.
1. Lack of Tension. If there's no tension in the combat, the players will likely not be excited about in engaging in it. If the outcome is a fore-gone conclusion, there's no sense rolling out 3 rounds of mop up just because the rules say that's how it should be done.
**If you use CR critters you generally end up with tension. You can also end up with dead PCs, so its a gamble. **Tension can also come from creating situations where the party has goals other than just defeating the monsters. If they just need to get through the area, get away, retrieve the evil artifact, the success/failure of that point can cause great tension, provided you through some fun challenges in their path.
**Adding specific win conditions can also be fun puzzles. Perhaps they fight trolls in an area that prevents fire magic. Perhaps they need to kill a caster before he gets a potent spell off. Perhaps they need to defeat their enemies in silence so reinforcements aren't alerted. Crafted engaging scenarios allows for interesting combats.
**If tension has been lost, the DM needs to just cut to the end ("So you defeat your enemies...") upend the situation using whatever fiat or contrivance seems likely to get the job done. Generally, I introduce an environmental effect ("The room's on fire!" or "The giant accidentally smashes a pillar, the roof is crumbling!"), time clock ("More orcs are pounding on the door!"), or generally repositioning ("The ogre knocks the melee fighters back with his club and climbs up the tower. There he taunts you and starts hurling down pieces of the battlements!"). I don't inflict attrition on PCs (such as damage or serious conditions) but I will knock them down, reposition them or occasionally place them in a predicament that forces their attention. Most people have seen enough action/adventure movies to know what's called for.
2. Repetition. Doing the same thing over and over again gets tedious. Many cool abilities or choices have a resource cost to them, causing most players to resort to their bog-standard basic at-wills most of the time. "I swing, I hit." "I swing, I miss." It can get a little boring. Narration and context can spice things up, as can high-stakes, close-fought battle; but a melee attack roll is still just a melee attack roll. We've probably all made thousands of them.
**I found the best thing here is to encourage interesting plans, tactics, strategies and team work by allowing anything that sounds plausible and even handing out minor bonuses (+1 to a roll or even advantage or inspiration or whatever makes situational sense). Usually, the more boring the combat we've gotten into, the bigger the bonuses. Once again we're in action movie territory. "Wait, the orc chief has one eye! I wait til his misses a strike, quickly step to his blind side, and wallop him!" "I cut the rope to drop the chandelier on the wyvern!" "I throw my sword at the dragon's open maw just as he begin's his fire breath attack!" Anything to get away from the constant monotony of constant basic attacks. Do this for monsters too.
**I will commonly give improvised knock back, knock prone, area attack and grapple effects to my monsters. I usually allow a Strength save to avoid it and, if the player does, they can use a reaction to make an opportunity attack against the monster. Large baddies will knock you around. Smaller ones will jump on your back and stab you repeatedly in the neck. It's all in good fun.
3. Slowness of Play. A slog can happen in even otherwise interesting combats if the rounds take too long. Luckily, 5e is intrinsically better than 3x and 4e for this but sometimes things slow to a crawl. It's up to the DM and players a particular table to figure out if anything here needs to be addressed. The DM should be as prepared as possible to run the baddies quickly and accurately at least and constantly be mindful of the clock. Streamline rules whenever possible. Ignore everything that doesn't really matter to the situation at hand. And encourage the players to act quickly and decisively.