Generals are high-ranking military officers responsible for leading large formations of ground troops. They may be called upon instantly by any army, or trained at high-level military buildings; the latter type of acquisition is more likely to see a general with better traits. As time progresses, they age, and gain (or lose) traits and ancillaries based on their combat performance. They can have powerful influence in battle, rallying routing troops and inspiring their men.
In combat, generals are protected by a relatively small mounted bodyguard. While they are few in number, this force is usually more than a match against lighter cavalry. They can also be used as a shock force, although charging a general into combat places his life at serious risk.
In the Grand Campaign, generals are best assigned to large stacks of troops, preferably those which see the most action. Generals are also vulnerable. While generals are prone to dying of old age by the time they reach their late 60's (and usually before they reach 80), Rakes, Thugees and Hashashin can attempt to assassinate them, making counter-spying vital to their survival. Likewise, assassins can be sent after enemy generals if possible, leaving their armies weakened.
On the battlefield, generals can help turn the tide of battle. For nations with limited cavalry forces, generals and their bodyguard can be used as an impromptu shock force (especially the Maratha Confederacy and Mughal Empires, with their elephant-mounted generals). However, such tactics are risky at best, since a lucky shot or a prolonged melee fight could kill the general, dealing a heavy blow to their army's morale.
Due to their capabilities, generals are high-priority targets on the battlefield. Artillery can bombard them and their bodyguards, and a well-timed charged and ambushed with cavalry and infantry can also kill generals. Killing an enemy general does significant damage to an enemy army's morale and can push wavering men into a full rout.
An army with no specially assigned general turns a random soldier in a unit (generally cavalry) into a general. They still serve to inspire nearby units, and can still be killed in combat, however they can't gain traits, and if the unit chosen to host the general is infantry or militia it can put your army at a serious disadvantage, as well as restricting their ability to catch up to fleeing allies. On top of this, they can't hide, so if the unit chosen is light infantry etc. then it can restrict stealth tactics.