Hit and run is a trick used for fighting monsters which may have powerful melee attacks, but are slower than the player, such as mimics, black puddings, and rothes. This tactic is known as hack-and-back in Angband circles.
A monster can use each turn it gets for either movement or attacking you, but not both. For example, if a monster moves at least twice as slowly as the player, it cannot melee you the turn immediately after it moves, and you can safely attack it on that turn.
All slow monsters have to pause a turn at a predictable rhythm, e. g. always after three movements. You can hit such a monster as often as you wish without a single counterattack: You start stepping back immediately after you attack it, and then you attack it only when it moves adjacent to you right before its scheduled pause. You can use hit and run tactics for all of your attack types: melee, pounding, missiles, and spells.
This will work reliably only if your opponent is slower than your normal, base speed of 12. Even if you have magically enhanced speed ("fast" or "very fast"), your speed will randomly vary between normal and twice normal . You should not count on your extra magical speed for hit-and-run tactics unless you can take a hit or two or are attacking from a distance, even if that means to waste turns.
If you are hit-and-running in a circle along hallways or around a boulder, watch out for monsters that could block the path ahead of you.