In the battles of the Middle Ages, ranged weapons and projectiles of all types played an important role. They were used as weapons of attack against individual targets on the battlefield and during sieges. In some cases they were used as weapons against a certain given area on the field.
The firing of arrows and projectiles allowed to cause casualties from a distance. The archers were used as light troops to deplete the forces and to decrease the morale of the army enemy, causing losses before the start of the battle. If they could weaken or affect the enemy forces, your chances of winning the battle increased.