Stealth

A creature with Stealth will be invisible to all enemy creatures unless he is revealed by either Stealth Detection, or by failing to disarm a Trap. Once revealed, the creature cannot become invisible again, and will act as a normal fighting creature at that point. Once detected, a creature with Stealth will only return alive if it manages to kill every enemy creature that it encounters. Creatures with Stealth usually have terrible stats for their level, so that does not happen often.

Creatures with Stealth can play one of 3 different roles, depending on the creature and the situation:

Raiding
A thief will always move directly for the target room (or the Settlement Vault), collect the loot, and move directly for the exit. If he encounters any traps within his Trap Disarm range, he will attempt to disarm them. He will ignore everything else unless he is detected, at which point he behaves like a generic melee creature.

A ghost will function similarly to the thief, but they will not attempt to disarm traps. The ghost will also fly over the lava instead of following the path of rooms/hallways.

Defending
All Stealth creatures will check for non-melee units (ie, ranged units or priestesses) in their awareness range while they move towards the entrance. If a non-melee unit enters their awareness range before they reach the first enemy, they will run past the melee units in order to engage the ranged units. This works particularly well with the Backstab ability of the thief.