The bow was dominate before the use of heavy armor became commonplace, and you had a faster rate of fire than xbows. Xbows inevitably became more powerful, which could defeat heavy armor and iirc, one of the popes tried to ban the use of xbows because they killed heavily armored knights with ease before they could get into melee. An interesting and very effective unit was the “Pavise crossbowmen”, which would carry a huge tower shield with legs that could stand up without holding it, while you could fire and reload with relative safety behind it. Some pavise xbowmen would strap the tower shield to their back, and would turn their back to the enemy while reloading, then turn and fire quickly before turning to reload again. Even earlier, the Romans used a “testudo” or tortoise formation to protect the unit from all sides and above from missiles.
A wise general wins before the battle, while the ignorant general must fight to win - Zhuge Liang