I've posted this before in response to a similar question (someone else, been too long, gets credit for the original ideas).
(1) Don't make your combats about "fight to the death" and (2) spice monsters up by giving them bonus and reactions. MM monsters by default are boring. One of my favorites is the A5E improved frost giant that, if it knocks you down with its melee attack, can take a bonus action to try and curb stomp you with its boots.
Defend the Innocent: The enemies aren't focused on the party, they're focused on a defenseless third party that the party needs to intervene and protect.
Stop the Ritual: The party has X turns to stop A Bad Thing from happening.
Achilles' Heel: The enemies are nearly impervious to conventional tactics except for a specific, crippling weakness that the party can exploit.
By The Power of Greyskull: The battle has some kind of power-up that the party can leverage to make an unwinnable fight winnable. Maybe the enemies have powerful, enchanted weapons in their armory and the party can steal them and use them for themselves, allowing you to throw more powerful enemies that the party shouldn't be able to fight at their current level. Maybe there's a magical wellspring that allows the spellcasters to regenerate spell slots, allowing them to cast their highest level spells more times than normal.
(Don't) Kick the Dog: A sympathetic character is fighting for the enemy, maybe mind controlled, maybe it's a misunderstanding, maybe the party just doesn't want to hurt this character, and the party needs to find a non-violent way to take them out of the fight, while they have no problems attacking the party. Crowd control is the key to this battle.
The Floor is Lava: Safe ground to stand on is ever-changing and dangerous. Maybe the ceiling of the ruined temple is collapsing, and each turn some rubble falls on a chunk of the battlefield, with only a round of warning before it does. This forces players who may be content to try and hold a position to move, potentially taking opportunity attacks or losing advantageous positioning.
Hold the Line: The battle is a test of endurance, the party has to survive X rounds against a seemingly overwhelming force before the tides of battle turn in their favor. The more avenues the players have to hold, the more they'll be stretched thin.
They Live: Enemies rise from the dead, have a second wind, or tap into some source of rejuvenation once defeated, and must be defeated again, this time with extra abilities.
Mêlée à Trois: A battle between 3+ equally antagonistic parties where the motivations for everyone involved is "the enemy of my enemy is also my enemy". See Jack Sparrow vs Will Turner vs Commodore Norrington from Pirates of the Caribbean.
Prove Your Worth: The battle includes a third party that is judging the players, or that they need to somehow influence to their side. This could be a gladiatorial combat where the group needs to win over the crowd, or maybe a subtrope of the Melee a Trois where the party has found themselves caught between enemies and a group of potential future allies, or maybe the maybe the party has stormed into the throne room to protect the king from his evil vizier and need to fend off the guards long enough to make their case. This is a roleplaying encounter mixed in with combat.
Hot Potato: The battle involves some kind of MacGuffin that can't be held by one person for too many turns and has to be traded off. Maybe the Orb of Baa'dGhai needs to be kept away from the enemies who want to summon the Dark Lord, but every round the players hold onto it they suffer a stacking debuff.
Reinforcements Incoming: Whether it's a Broodmother summoning more whelps, or battalions of soldiers arriving to the battlefield, this is a battle where the number of enemies can become overwhelming if not kept in check, and AOE attacks get an opportunity to shrine.
Enrage Timer: Each turn the enemies become stronger than the previous turn, so a fight that starts easy can quickly become overwhelming if the party tries to hoard their resources.
Romeo and Juliet: Enemies that are linked in some way and must be defeated within X rounds of each other or they will heal their counterpart.
Solve the Puzzle: The Ur-trope, there is some sort of puzzle that has to be solved before the battle can conclude. Maybe the party needs to find a group of hidden runes scattered in different corners of the battlefield to reveal the password to open the door that allows them to escape from a zombie horde.
Team Deathmatch. The outcome involves the survival of a single VIP, whether PC or NPC. Perhaps a barbarian warrior needs to prove that they’re tough enough to remain standing during a battle or a cleric of a light god is channeling the force of their god—the only thing enough to push back the darkness that threatens to consume the entire party. This can be a great way to put the spotlight on a specific character and allow them to shine (sometimes literally).
Capture the Flag—instead of protecting a VIP, you’re fighting over an inanimate McGuffin, like a magic rune or bag of gold. As the MacGuffin trope is an extremely versatile tool in writing, this is an extremely versatile objective in combat design! Maybe once the party defeats the warlord, her underlings will try to grab the body and escape to resurrect her! Maybe the party’s goal is to steal a magic gem that’s guarded by a horde of eternally reanimating skeletons! Maybe the party has reached the end of the dungeon at the same time as a rival adventuring party, with both approaching the artifact contained within from opposite entrances to the final room! Now, in many Capture the Flag combats, battle may eventually degenerate back to a Team Deathmatch state, but simply having an objective can force battles to happen in circumstances that aren’t ideal to either side. Besides, it’s not like there’s anything wrong with Team Deathmatch combat, and the times it doesn’t lead to that can lead to some very hectic chases and clever uses of non-damaging combat abilities.
King of the Hill seeks to control a location. Now, this location can start under the control of either faction or start as initially neutral depending on circumstance, and each situation leads to a very different type of encounter. If the location is initially neutral, this functions like a Capture the Flag scenario where the dominant strategy of ‘just run away’ isn’t possible. If possible, try to make ‘tanky’ characters like paladins and fighters really feel dominant when the battle reaches maturity, but favor speedsters like monks and rogues during the initial phase of battle. You can do this by applying a two turn ‘countdown to victory’ for controlling the location uncontested, and deliberately setting up the scenario so it takes a ‘normal’ character one-and-a-half movements (two turns, with an action left over) to reach the location. This means that fast characters can get in an initial advantage but can’t win the scenario outright. A reasonable scenario like this might be taking a bridge. One side wants to hold it so that it can be destroyed, another side wants to hold it so that an approaching army can cross. A ‘defensive’ King of the Hill might involve the PCs holding a specific door against enemies that want to burst in and assassinate whoever’s inside. An ‘offensive’ King of the Hill might involve the PCs trying to remain inside a ritual circle to disrupt the summoning of a dark god. The potential combinations are nearly endless, just realize that, just like with the Capture the Flag variant, the PCs will come up with all sorts of janky strategies to completely circumvent fighting the encounter. To a certain extent, let them. That’s part of the way that D&D is different from a video game. It’s part of the fun!
Leaving MacGuffins behind, what if enemies didn’t all attack at once? This is Wave Defense, and it’s probably the most common of these suggestions in actual play. Still, I figure it’d be worth mentioning here in part because fighting one big battle is more fun than fighting a bunch of little ones. However, it’s easy to overwhelm PCs though the use of the action economy (a lot of enemies, few PCs). The solution is to throw the enemies at them in waves! This also can make combats last longer than the traditional three round length. That’s not all, however. The ‘alternate objective’ comes in with what I call the ‘Cross the Finish Line’ objective for enemies, which is a classic component of the Wave Defense in other game. Perhaps the party is defending a wall breach against attacking soldiers, or a holy gate against a horde of demons. The enemy can’t attack all at once due to the size of the gap, so they come in waves. Either it’s defeat a certain number of enemies or hold out for a certain amount of time (another alternate combat objective) in order to achieve victory.
Another sort-of alternate combat objective is the Free for All, in which survival is focused on as the goal over body count. Though it’s become popular in the modern consciousness with the Battle Royale genre, the Deathmatch is a long and storied tradition in video games which can be applied to your D&D game with the appropriate level of worldbuilding. A classic of the mega dungeon is the existence of multiple warring factions within the dungeon. Perhaps this comes to a head with a battle between two factions? If either faction wins decisively, it makes the PCs lives much harder, so it falls on the PCs to ensure that any victory is pyrrhic. Perhaps an otherwise normal battle is interrupted by a wandering monster looking for an easy meal? Perhaps the Big Bad’s underling sees the climactic battle with the PCs as the perfect opportunity to betray their boss an eliminate both groups in one fell swoop? The Free for All is the perfect gift for the Diplomacy player in your game group—a challenge in which strategic thinking and diplomacy RP becomes just as essential to winning an encounter as optimal character design and tactical ability!