The Internet contains numerous articles about creating an ecology for your dungeon. Creating a dungeon ecology is an interesting thought experiment. A forest has a vibrant ecology. However, a party of adventurers will get bored if all they run into are chipmunks, rabbits, and deer. A dungeon master needs to include something challenging. Players will abandon the campaign if they go through endless descriptions of beautiful forest creatures living in harmony without any conflict.
One solution is making the creatures less benign. For example, the party notices the squirrels stop what they are doing and watch every move the party makes. One of the squirrels scampers up ahead to the next set of trees. You see the squirrel communicating with the next group of squirrels, which start watching the party. The squirrels observe every step the party takes and forwards the information to the next group of squirrels. The forest no longer seems benign. Someone or something with intelligence is watching the party.
A dungeon master can make any environment feel alive. It does not require living creatures. Consider a simple set of empty rooms in a dungeon setting. The party enters the first room. They find nothing. As they enter the second room, the door to the first room loudly slams shut. The party decides to spike the door open. When they enter the third room, the door to the first room slams. The party runs back and sees the door is now spiked shut. Something closed the door.
A cleaver DM keeps the party interested by variety. In the forest, instead of only squirrels the party sees the squirrel run up to a crow. The squirrel seems to communicate with the crow. The crow flies off. In a dungeon, the dungeon master has a variety of options. In the movie The Changeling (1980), one of the scariest scenes is a web rubber ball bouncing down the stairs.
Imagine the reaction of a party of adventurers when they read graffiti on the wall saying, "The lunatic is in the hall". Later as they find more graffiti saying, "The lunatic is in my head". I stole this idea from the lyrics to Brain Damage by Pink Floyd.
Most players do not care if your dungeon ecology is logically consistent. They care if the dungeon is fun and interesting. This is the core of the complaints in the reviews of the Dwimmermount megadungeon.
In addition to making the adventure fun and interesting, you need to provide the opportunity to kill something. I love sessions where none of the players needs to swing a sword. However, experience teaches I need to provide something for the party to kill or some of the players will get bored.
Back in the forest, the party continues down the path. The party sees the squirrels and crows watching their every move. Suddenly, the squirrels pelt the party with acorns. The acorns cause no damage. The party can kill a bunch of squirrels or ignore them. As the party progresses down the path, the squirrels continue their barrage of acorns. The party sees a squire step out on a branch holding an unusual looking acorn. The squire bites the stem off the acorn, then with all its strength throws the acorn. The acorn hits the fighter and explodes causing 1D6 damage.
A squire with an acorn grenade is almost as much fun as a Kobold with a ballista.