In my experience there are two general types of multiple-encounter dungeons in dungeon-crawls. Logical and Magical dungeons. I could call these Logical and Illogical but generally speaking players accept 'a wizard did it' pretty readily when encountering what would otherwise be a pretty illogical dungeon construction. More on this later.
A Logical dungeon is a dungeon that makes a lot of sense to exist all on its own. Examples being things like caverns filled with bats, temples filled with priests, and prisons filled with guards and prisoners. These types of dungeons are often pretty short and simple, because they can have a tendency to become boring or deadly if too large.
A Logical dungeon is not the kind of place that's populated with puzzle rooms, riddle spitting sphinxes, or gargoyles that speak only lies or truths. Instead, these dungeons will be filled with natural puzzles, monsters that fit into the scenery of the dungeon and sense that there are reasons for things that exist in the dungeon.
The PCs might be fighting tree-dwelling elves over a magical item. The dungeon could then be the connected tree-tops of the elves' city. You would encounter things like soldier elves at choke points, bridges that have been cut down to bar their path, released animals, and ambush style traps. In this case, starting with a city layout that was built with defense in mind will increase the realism. Laying in elements that make the city come to life, such as uses for the buildings the PCs travel through (inns, stores, barracks, religious centers, homes) and a lack of encounters that don't make sense to exist in the tree-tops, will all come together to create a believable dungeon to crawl.
Conversely, Magical dungeons are intentionally fantastic and unbelievable in their arrangement and construction. They don't have to make logical sense. It is probably a bad idea for every dungeon that the PCs visit to be like this, but every once in a while it is good. These are often what people classically think of when they think of a dungeon.
Do you have a room that is totally isolated from the outside world by a magical puzzle, yet is somehow filled with living creatures? You've got a magical dungeon.
To sell this type of dungeon you need a wizard or other magic user that probably is somewhat mad and absolutely has too much time on their hands. These dungeons are built to be solved. They are built to reward adventurers for little reason beyond boredom on the part of the creator. These are the dungeons that are filled with chests containing magic items which are being guarded by strange creatures. Why are the items here? Why are the creatures? Who knows. Why is there an ogre buried deep in a mountain alone who only wants to present people with logic puzzles? Why is there a room with magically moving platforms that hover over lava? Why are there random gates to distant realms pouring eldritch horrors into corridors? Because it was funny and the mad wizard just wants to be entertained and had these swords of lightning just laying about anyway.
These two basic types of dungeons can be combined. Sometimes, the Magical dungeon has been mostly explored, the remnants of solved puzzle rooms being recently used by bands of orc raiders, or tunneling beasts have broken into sections of the dungeon from outside. In these cases it is important to remember that while the maddened construction of the Magical dungeon itself doesn't need to follow any real logic, the later usages of the spaces do need to be logical.
The converse is also true. Sometimes a natural cavern is co-opted for use as a Magical dungeon. The caves might be filled with floating magical platforms that can only be stood on for 6 seconds before vanishing, but the natural pools of water should appear as such.