There needs to be some randomness to combat, but the various factors make things somewhat predictable.

Missile kills are based on different missile type stats in the projectile_stats.txt file. The big stats are Range, Accuracy, Lethality, Power, and ArmourMod. To the best of my knowledge, the only thing that affects a unit's missile performance is valour, which improves the accuracy.

There is friendly fire in the game, the computer is more than willing to let you shoot your troops in the back. The velocity stat affects the trajectory of the missile, a flat trajectory like bullets and crossbow/arbalest bolts really need a clear shot to prevent lots of friendly casualties. This is compounded because armour is the only defense against missiles, and these are AP projectiles. With regular archers, shooting into melee is a little better, especially if your own troops are more heavily armoured. The arc keeps the hits on your own men down, but they will still get hit.