Whenever I watch a movie involving fight scenes with muskets and black powder weapons I cant believe how inefficient the whole thing seems.
Couldn't you just charge a mass of soldiers with axes and spears into another with muskets? They may get one shot off but after that you would think it would be game over for the muskets?
Your question seems to be more about black powder weapons in general, rather than just "muskets," so I include arquebuses as well in the answer.
At the time of the introduction of muskets, warfare was typically fought between large pike formations and heavy cavalry. These large pike formations were typically very slow and very dense in men, the idea being that such a force was needed to deal with heavy cavalry charges. These were often supplemented by archers and crossbowmen, who would be able to shoot and engage these slow moving pikes at leisure, but would need to be protected by pikes of their own to stop them from being run over by cavalry.
Hand firearms were first commonly deployed in the Spanish "tercio" formation, where a tercio was essentially a company of troops. It was composed of a large, slow moving pike square, with "wings" of musketeers and arquebusiers. The idea was that these musketeers would engage the enemy at range, and in the event of enemy cavalry, they could quickly withdraw into the safety of the pikes.
The main disadvantage of the tercio was that it had a relatively low rate of fire, and it was slow. Maurice of Orange, the lead stadtholder of the Netherlands, defeated the Spanish tercios by deploying his musketeers in a more rectangular formation, giving his shooters more surface area to fire against the pike square, thus giving them an overall improved rate of fire.
The main advantage of firearms was not that it was classy, or even its killing ability. Firearms were extremely inaccurate and the main usage was in massed rate of fire, the idea being the more you shoot the greater the chance that something would hit. The main advantage of firearms over say, longbows, is that they were cheaper. A longbowman needed to be trained for a long time, sometimes years, to become proficient at its use. A musketeer could learn how to shoot and drill in a matter of weeks. This allowed armies to be raised much quicker and much cheaper than in the feudal era, and as standing armies are expensive, firearms were seen as a way to help alleviate the cost of maintaining one.