"The Locrian squadrons nor the javelin wield,
Nor bear the helm, nor lift the moony shield;
But skilled from far the flying shaft to wing,
Or whirl the sounding pebble from the sling"(Iliad, 891–894, trans. Pope)
There is an almost gladiatorial symmetry to the weapons used in ancient combat.
A sword or gladius by itself would be no match against the bow and arrow unless one also carried a stout shield. Then the pilum would have to be used to pierce the shield, the long metal shank of the spear bending to prevent it from being cut away or returned. Of course, no weapon is of use once it's been thrown away, and the pilum would not do if one's adversary still was wielding a sword.
It almost becomes like an ancient version of "rock, paper, scissors." Arrow defeats sword, defeats pilum, defeats shield, defeats arrow.
And what defeats even the arrow: the funda or sling, a weapon, surprisingly, that could out-range the bow and arrow and hurl a cast lead slug or glans that caused remarkable damage. Vegetius, in fact, considers the stone shot from a sling to be more dangerous than the arrow and recommends that it be carried by all recruits, given its light weight and the ready supply of stones (Epitome of Military Science, I.16).