I think it has to do with the fact that those units do not have Fire at Will turned on by default. If you approach an AI Comitatenses unit they won't throw Pila at you, but if they decide to attack, then they will throw a volley and charge. Again, it's simply because the AI doesn't know how to turn on the Fire at Will ability.