Archers should potentially target all enemy units within range, with chance based on unit size, perhaps with a moderate preference for those within shorter distance. A large mass of peasant rabble or infantry is going to be a more tempting target than a small, charging cavalry unit, even if the latter might pose a greater threat to the archers.
I understand that the motivation is to stop us from sending on a small unit in front as a "pincushion" unit.