There are many different locations in which combat can occur. However, due to the nature of dungeons, often times it's in a confined space. It could be inside a small building, inside the tunnels of a mine, or on a floating platform. Regardless, these kinds of situations restrict the movement of players and enemies alike and come with their own challenges. It is these elements that I hope to discuss. As always, I'd be happy to hear other opinions.
Getting Locked Down
One of my big enemies when designing combat encounters is the static encounter. I don't want my players to get locked into one position where they'll just spend their turns rolling dice and nothing else. The problem is that confined places make it easier for this to occur. There isn't much distance to cross so the enemy can quickly get up close. There is also often nowhere to go. In systems that have some form of penalty for leaving reach, moving away is often not worth the penalty and we end up with a static encounter. In a confined space this is compounded further. Even if we do try to move away, there's often not much room for us to move.
One of the best solutions I've found in these kinds of situations is for the encounter not to last long. This way, even if players do get locked into a position, combat will be over soon after. What this often means is enemies are easily dropped and tend to deal a large amount of damage. This can be a bit hard to balance, particularly at higher levels, since this kind of combat can be very swingy. At low levels most enemies do a fairly large amount of damage relative to the health of a player character anyway. However, doing things this way ensures that the position chosen matters (a good position will result in fewer resources lost) but avoids the long slog. They can do normal amounts of damage too, but in that case it'll be a series of encounters that tries to chip away at the party. It naturally doesn't work as well with set-piece encounters though. In those cases you'll want something else since the idea is to have something a bit longer and more epic.
Sub-Optimal Dungeon Master Actions
It takes two sides to get locked down. What this means is that in situations where you can't reasonably expect players to move since it's against their own interests, you can break the stalemate. This way things get to be more dynamic. So what if your NPC gets an opportunity attack against it? The player can now move now and make for an interesting encounter. Of course, there will be times when someone will get past the player. This is great because the players will now need to decide how to deal with the NPC that slipped past their defenses. In some cases, though, this won't make sense. It will also get stale quickly if we take the same sub-optimal actions every time. The enemy shouldn't be leaving reach only for the sake of making combat more interesting. There should be an in-game reason for doing so, such as wanting to take out the spellcaster or retrieve an item held by a different player.
In a confined area with no obstacles, often the only thing blocking line of sight and preventing movement are other people. In a small enough place this can be a real limiting factor. However, we can also put obstacles into the area to further block line of sight in certain situations and extend the movement needed to reach someone. Sometimes these kinds of constraints can be exactly what we need to change things up. The extra distance can also work wonders for creating different kinds of situations. We want to keep multiple paths so that meaningful decisions involving movement still need to be made. With small enough rooms, we can link multiple ones together to make a less uniform area.Not all obstacles will prevent both line of sight and movement. It could be one or the other.
Bends in the Road
The reason I thought of this topic was because of a situation I ran into during one of my sessions. The session involved some plane and time hopping. Naturally, the players had found themselves in trenches in a roughly WW1 situation where I had used a tile set to build a trench system. One particular combat encounter happened around the bend in the trench. Different characters were lying in wait for people to try to peek around while others party members were peeking around and trying to attract attention. One tried to use the flooring to build some impromptu cover. It's a different kind of encounter but it's one worth considering. It's also something that can be kept in mind when creating an encounter close to a bend in a dungeon. You may accidentally run into this situation. In this case, the confined space itself provides ways to break line of sight. Doorways can result in similar situations as can other choke points.
Temporary Area Denial
Confined areas can be full of many things. Some of these things are flammable and can prevent certain areas from being used. I say this because in my last session, a barrel caught in a fireball ended up exploding and blocked off access to part of the room. Traps are another common method to temporarily block access to part of a room. This is especially true for some traps that need to be reset since once they are set off, they may be no-longer a hazard. If there was a span of time since players were there, rain could have made rather large muddles or have made certain parts of the dungeon slippery. When possible though, don't forget to apply them to your own NPCs unless they have some kind of immunity. There is nothing wrong with a fire-immune demon walking through a wall of flames or a ghost walking straight through a trap. However, your regular bandit shouldn't be able to without consequences.
Even in confined spaces, some interesting events can occur to break things up. A third group could join the fight, the statue in the centre of the room could be attacking the party and their enemy indiscriminately, shells could be exploding (in the case of the trench example above) or a host of other situations. From my experience the ones that work best will somehow chance the area. Either areas will be further restricted, new temporary ways of breaking line of sight appear, or obstacles previously there are taken away.