Efficiency is initially set at 100%, and is reduced by the act of causing Fatigue, and several spells/items, and can be increased by certain heroes (depends on hero color&race, and unit color&race matching), as well as very few spells.
Efficiency is the same for both primary and secondary attacks except in the case of the modifier "Charm". Charm reduces efficiency by 50% (linear), though ONLY for Primary Attacks.
Heroes raise the effiency of the stack they lead - 1% per level of the hero - so typically 9-22%. In order to gain an efficiency bonus from a hero, the stack lead by the hero must match the same color and race as the hero.