You can set your army to automatically retreat, defend, or stand and fight if it is attacked. This is largely a way to give orders to your troops while you are not on line. Even if you are on line, you have to set your standing orders to "defend" or "stand and fight" if you want to accept battle with another army.
1. Retreat: It is prudent in most cases when your army is outside the keep to set your army to "retreat." You never know what your enemies will send after you while you are not online. If attacked, an army set to "retreat" will move up to six fiefs away in a straight line. The Player Character commanding the retreating army suffers a small stature loss each time his army moves away. If the attacking force has overwhelming strength, it may be able to force the "retreating" army into battle. This usually results in bad things happening to the army of the PC trying to retreat.
2. Defend: This is a valuable command when you want your army to hold its ground outside of the keep. An army set to "defend" will fight if attacked. In addition, no one else can pillage or beseige the fief your army is in, unless they first attack and defeat the defending army. This command is most often used during multi-season sieges of strong keeps. It is also a useful way to guard a valuable, but low-keep, fief from attack. At some future date, armies set to defend in the fief may receive a combat bonus, and armies set to defend inside a keep may have their strength added to the garrison, but these changes have not yet been coded.
3. Stand and Fight: Used in conjunction with "Sally Value", this is the most common command for armies inside a keep. An army set to "stand and fight" inside the keep will attack enemy armies trying to siege the fief, depending on the combat odds and the sally value. In the open fief, an army ordered to "stand and fight" will accept battle just like an army set to defend. But it will not stop other armies from pillaging the fief or besieging the keep.
4. Sally Value: The sally value determines when your army will sortie from inside the keep to attack a besieging army. A Sally Value of "9" means that you will only attack if your force is at least 9 times stronger than the beseiger -- truly overwhelming odds! A Sally Value of "1" means that you are willing to take your chances on an even-odds attack. After a "sally" your army automatically goes back inside the keep.