The behaviour of your units can be adjusted according to the combat situation. There are two sets of behaviour buttons, a general one for all units, and a second set which only applies to Archers. The basic behaviour buttons appear in the middle of the Battle Army Panel, while the archery options are displayed at the top of the same panel.
Units in battle can choose from 3 different unit behaviour types. Aggressive units will attack hostile units that get too close. In Hold mode they will stand their ground, even if they suffer from ranged attacks, although they will engage if they are attacked in melee. A Defensive unit will try to avoid battle. You can set your Archers to “No Fire” mode, in which they won’t begin shooting on their own. If you select the “Don’t Shoot Into Melee” option, they will only target enemy units that are not engaged in melee, and so prevent you from damaging your own units. If you choose “Free Fire”, your Archers will target any enemy within range, regardless of proximity to your own troops, and try to deal as much damage as possible.