
In nature all of combat or violent interaction between species is done in close ranges. Most species are melee based and, even though some have range attacks or can sprint quickly for a short distance - these are still ultimately based on approaching your target physically.
This, of course, evolutionarily has many disadvantages. You have to have some kind of deceptive or distracting adaptation because otherwise your prey or enemy will detect you. This can present many problems and often the energy involved in catching prey by means of close quarter combat is usually wasted.
However mankind was able to supercede all of that by inventing bowhunting. Bowhunting was one of the most significant inventions of all time because it changed the dynamic of combat and of acquiring food. What we lacked in speed or strength we made up with the ranged attacks of bowhunting where, often, a target was totally unaware of their impeding demise.
Naturally the usage of ranged attacks also later involved into automated varieties and, with gunpowder, modern warfare devices. Nevertheless it all started with the bow and arrow thousands of years ago.