Phased out? Says who?
Slings were used in European armies until the 16th century...the
Castilian king had 30,000 infantry slingers in 1386...The sling was last used in Europe for military purposes at the siege of Sancerre in 1572 by the Huguenots.
Here is a lovely illustration of slingers at the Siege of Damietta in 1219, operating alongside archers and against opposing crossbowmen.
So why weren't armies composed entirely of slingers, rather than archers?
The sling's primary weakness compared to the bow was the high skill level necessary to use it effectively. While a true expert with a sling could use it ambidextrously and with great accuracy, that level of ability required training from a young age. Harrison proposes that there were simply fewer trained slingers to go around:
Increased cultural diffusion and urbanization in the Middle Ages meant local cultural traditions, such as slinging, were weakened...By Medieval times, there were few pockets of experienced slingers left
Additionally, the way in which troops were deployed had evolved. Ancient slingers were great skirmishers but the space required for a slinger to operate made them a poor fit for the medieval battlefield of tightly packed bodies:
It would have been troublesome to pack multiple rows of slingers into a typical medieval assemblage, where each soldier would fire over the row in front of them. Even a slight misfire, launched in front but too low, could cause friendly casualties. Archers could simply point upwards, over their fellow soldiers’ heads, and could be formed into relatively dense formations.
Compare this to the tercio, a formation that is gaining popularity at the start of the Early Modern period right as firearms become widespread (tail end of the 1490s into the 1500s). It leverages the great strengths of pike and musketry (relatively low training required) to overcome their weaknesses, by massing soldiers of both types together. Musketmen provide volley fire from a "bastion" of pikes that protect them against being run down by cavalry. It would not be easy to raise such a number of trained slingers, nor to have them operate shoulder-to-shoulder.
Slings got a new lease on life as the vehicle for grenades (or in a pinch, hot coals) but ultimately, like bows, they were made obsolete by rapid advancements in firearms and plate armor.