To a fungus gnat larva, a rove beetle is a predator. To something larger, it may be lunch. Being good at eating things does not exempt you from the food chain.
Dalotia coriaria has an answer. When threatened, it can lift its flexible abdomen and release a defensive chemical mixture. The posture looks a little scorpion-like. There is no sting. [1]

Two ingredients need each other
Inside the gland, two specialized cell types do different jobs. One makes benzoquinones, defensive chemicals. The other makes a liquid mixture that dissolves and carries them. The mixture's ability to spread matters alongside its chemical potency. [1, 2]
Think of a powder that needs to dissolve before you can spread it over a surface. The active material matters, but so does the liquid carrying it. The beetle produces both.

In experiments, interfering with either manufacturing pathway weakened the beetles' defense against ants. The cooperation was doing real work. [2]
A new organ from existing tools
That cooperation led researchers to a larger question: how does an organ evolve when it needs different cell types to function together?
The Cell study traced the gland's chemistry to combinations of older cellular machinery. Pathways associated with functions such as energy metabolism, cuticle production, and lipid handling had been brought into new arrangements. The result was a specialized organ with a new collective function. [1]

Those new combinations were inherited over evolutionary time. Each beetle develops its gland using that inherited machinery; it does not assemble an emergency chemistry lab when an ant appears.
The gland makes the idea of an organ tangible: different cell types contribute to a shared job. Here, the job depends on combining their secretions. Neither part alone performs like the finished mixture.
Evolution did not start with an empty workshop. It found another use for tools already on the bench.
What you are watching in the pot
For a grower, the immediate lesson is small: a beetle lifting its abdomen is displaying a defense, not revealing a new method of treating fungus gnats. Its pest-control work still involves finding and eating prey.
The larger lesson is why this beetle deserves more attention than a release instruction. Something small enough to disappear between pieces of potting mix has helped scientists investigate the origin of complex organs.
You do not have to name every beetle in the pot. But it has earned a little professional respect.
