It is considered a relatively risky operation, requiring discipline to keep from turning into a disorganized rout or at the very least doing severe damage to the military's morale.
A withdrawal may be anticipated, as when a defending force is outmatched or on disadvantageous ground, but it must cause as much damage to an enemy as possible.
That could include setting mines or booby traps during or before the withdrawal, leading the enemy into prepared artillery barrages, or using of scorched-earth tactics.
Once a force has become disorganized and has lost its ability to fight, the victors can chase down the enemy's remnants and attempt to cause as many casualties or to take as many prisoners as possible.
The act of feigning a withdrawal or rout to lure an enemy away from a defended position or into a prepared ambush is an ancient tactic, which has been used throughout the history of warfare.