A little military history and a little lesson about technology.
Guns and cannons replaced bows and catapults in Europe and Asia beginning in the 13th century, and ending in the 16th century; that is to say, by the time the 16th century ended, the bow as a military instrument was considered largely obsolete.
Why? It's easy to see how artillery was replaced; it was much easier to throw massive objects with chemical, rather than mechanical, energy; cannon were far superior for reducing fortifications and smashing through human bodies, from the very start.
The mission of a musket is different. It's to kill some particular person. Military guns of the 16th century are smoothbore weapons, muskets and arquebuses; they're terribly inaccurate compared to bows. With much lower rates of fire, and in this era much less reliability, the gun was a more dangerous weapon to use. Backfires and accidents with slowmatches were quite common. The Mongolian horse archer of the 13th century would probably have been able to handily trounce a pistolier from the 16th century - probably, individually, deadlier than any of the types of soldiers fielded across Europe in the 16th or 17th centuries.
The typical Mongolian bow, with close to a 160 pound pull, fired an arrow with around 160 joules of kinetic energy (ref); for reference, tests playing a ~80 joule arrow at point blank against 15th century armor show it to be capable of just barely piercing period armor. There exists a raging debate over how effective the less powerful (100 pound typical pull) English longbow was against the very best plate armor, developed after the famous Battle of Agincourt.
Expert opinions range from "only at point-blank on a good direct hit" to "any shot within the effective range of the longbow that lands squarely," but the Mongolian bow is more powerful; accurate to about 80 meters in the field, the range at which large, round, and comparatively soft musket balls with a higher muzzle energy (but poorer ballistics and a larger surface area) could threaten plate, it can be expected to pierce plate armor with nearly every square hit at that range.
The fact that it could deliver 3-6 hits in the time that it took a musketeer to reload just about makes up for the fact that only a square hit would pierce; the gross inaccuracy of the musketeer means the Mongolian bow is almost certainly deadlier than the musket even against targets with good armor.
And good armor was not that common. I sometimes go as far as to suspect that a tumen of Chinggis's finest could quite possibly defeat a like number of 17th century German mercenaries in the field. So why, if the archer was better at killing more people in a hurry than the musketeer and the best bow of the 13th century was in many ways better than the best guns of the 16th, did the musket replace the bow so quickly?
The answer is complex. One factor is that when two armies face each other, accuracy is no longer as important; a poorly aimed musket ball or arrow is deadly no matter who it hits, and it will hit someone. Another factor is logistics: Musket balls and powder are easier to carry, and are easier to manufacture in large quantity. A third is training: A 16th century musketeer required no more than a few weeks to familiarize himself with his weapon to use it as accurately as anyone else could, while the deadly longbowmen of England's 15th century armies, and the deadlier horse archers of Mongolia's 13th century armies, required years of specialized athletic training.
And because of that, the bow was prohibitively expensive to use in armies, compared to the gun. Some would still use it to great effect once in a while, but it never regained ground as a battlefield weapon. In time, the greater kinetic energy of the gun was coupled with better ballistics, armor-piercing ammunition, rates of fire, and great advances in accuracy, outclassing the bow on all fronts; but to replace the bow as a weapon of war, it needed only more convenient ammunition and greater ease of use. Even allowing that a 15th century English longbowman, firing ten arrows a minute, was deadlier than the musketeer replacing him against all but the most heavily armored men, he was many times more expensive, and harder to replace.
And so the bow was replaced by the gun, in the far east and in the west. Here's where I generalize today's lesson on technology: The better technology is not always superior in all regards. It's even possible to go backwards in some respects - and yet still render the old technology "obsolete" quite authoritatively.