Once the total combat rating is resolved for all the units in the army it is then multiplied by
<CombatRatingToExpMultiplier>0.075</CombatRatingToExpMultiplier>
which is then split up depending on whether the unit is a champion or trained unit, henchmen fall under odd rules. After that it just depends on who lives and dies as to whether they receive experience. That line of code is hidden within the ElementalDefs file. You can also adjust how much experience total is given to trained units within the same file search for the line,
<ExpMultiplierOnDesignedUnits>0.5</ExpMultiplierOnDesignedUnits>.