I mean, sure, the firearms of the napoleonic era didn't reall suck that much anymore. However, in the late medieval ages, early renaissance european armies started to replace bows with early firearms like the Arquebusiers (or however you write that). But why? As far as I know, such early firearms were vastly inaccurate and a bow was way more effective.
Found this: https://www.reddit.com/r/AskHistorians/comments/15t5kr/what_brought_on_the_transition_from_bows_to_guns/
from a while back. Long story short: economics. You can make a gun faster and cheaper than you can make a bow, and can reach a high degree of proficiency with a musket in a short time, where as skill with a bow is learned from youth. Plus, even the best longbows couldn't punch through 15th century armor.
Edit: sorry, didn't know about username pings u/badgerfest.