How to position your army before battle and organise flanks go here - Army - Positioning and Organizing
For detailed unit's statistics go here: Levy (with stats)
For influence of terrain on the battle see Combat and Terrain
In a battle, each side has up to three flanks. These flanks will generally fight separately against the same flank on the opponent's side. Each flank has a commander, and its own units. To have more than one flank you need multiple armies, though they can be merged into one. An army composed of the soldiers from a church, city, and castle in the same province will suffice, but a single mercenary band will not.
Combat is divided into three phases; Skirmish, Melee, and Pursue. All battles will start in the Skirmish phase. This is when archers and horse archers excel, and they'll be the only ones doing any major damage. After a few days, it will switch to the Melee phase, where melee oriented units like heavy infantry and pikemen excel. Do note that flanks don't necessarily have to be in the same phase as each other, and they'll usually enter Melee at slightly different times. When the morale of a flank reaches 25%, they will start retreating, and combat will switch to the Pursue phase. This is where light cavalry truly excels, but heavier cavalry also does well. After 5 days, the flank will be removed from combat.
When a flank no longer has an equivalent flank to attack, it will help another flank instead. It will now also get a flanking bonus of 10%, meaning it does 10% more morale and troop damage. The enemy flank will now be under attack from two flanks, thus taking considerably more damage, and will thus usually be rapidly eliminated from combat.
Attack controls how much damage a unit does, while defense controls how much damage it takes. The higher the morale of a unit, the more damage is needed for it to retreat.
As you can see, only two units are any good at skirmish, archers and horse archers. This means that an army with many of these units has the advantage of damaging the enemy severely early in combat, which can at times make the difference between victory and defeat. Further, heavy infantry and heavy cavalry excel at melee, which is generally the largest part of combat. They're also not very vulnerable to the skirmish phase, and as such they can often win you the battle. Light cavalry on the other hand are only good at pursuit, so are as such only useful if you've already won the battle and want to inflict further casualties.
For the most part you and your opponent will have similar unit compositions, so this generally won't come into play much. However, when hiring mercenaries you should pay attention to what units you're actually hiring, and try to avoid mercenaries that are high on light infantry and archers, instead going for heavy cavalry and infantry.
Further, commanders have a moderate effect on combat. Every point a commander has in the martial skill increases the damage of his flank by 2%. As such, you should before important battles ensure that your flanks are using your best commanders so as to maximize your enemies' losses and reduce your own.
Contributed by Meneth