It came down to accuracy. Or rather: the lack of it. 

Until rifled guns became technically and economically feasible around 1840 - 1860 the best way to fight was to shoot with a large body of men simultaneous at an approaching large body of men. You wouldn't aim your gun, but point it towards the enemy. Muskets usually didn't have sights on them. There was no need for it. Effective range was up to about 100-150 meters. Beyond that was not realistic. A waste of powder and shot. 

There were (a few) rifled guns, for example the [Baker rifle][1]. Those guns were accurate, for the time even very accurate. The British [95th regiment][2] was an elite unit. You could only join it if you were an accurate shot already. Problem was that reloading was very slow. You had to literally *ram* your bullet down the barrel with a mallet. Which, of course, resulted in a very low rate of fire. Very accurate, mind you. The men of the regiment were instructed to aim at important targets. Preferably officers. Just like marines or SEALS today, that kind of men was in short supply. The British had only 2 rifle regiments.

The Austrians had a few units equipped with [air rifles][3]. Those rifles weren't bb guns but deadly, highly accurate and (for the time) rapid fire weapons. The French often shot soldiers armed with air rifles on the spot. They hated them as much as we do modern snipers. Those rifles needed air cannisters for refills, and the system was later abandoned. Too fragile in battle, and too complicated. Manufacture of the air cannisters was very difficult. 

But that kind of precision was not available for the rest of the army. The British had them, there were some German and [Austrian jäger units][4]. That's about it. The French didn't use rifled guns a lot. Their light infantry carried the standard musket of the army. 

So, the first thing you need to understand is the lack of accuracy. One could at best hope to hit *something* in a battalion sized target. Of course this was tried out many times in exercises. By every army. 

Second: Firepower. You could fire 3 to 4 shots per minute with a [Brown Bess][5] rifle. (Rifles had at best half that firing rate) That is the average. One could fire more rapid, but not in battle. All you could do is try to hit the approaching column and hope to hit something in it.

Third: combat stress. 3-4 shots per minute doesn't sound much, but try to do it, in battle. Lots of times soldiers forgot to pull out the ramrod and fired that as well. Or the musket misfired, and they added another charge on top of it. Misfired. Reload. Misfired. Another reload on top of that, and ... BOOM. That 3-4 shots per minute dropped considerably during a battle due to fatigue. 

Fourth: smoke. Black powder weapons create enormous clouds of smoke. You have to see it to believe it. Imagine +500.000 men shooting at each other with black powder artillery support. Smoke really obstructed the view. 

The only way an army could effectively fight with muskets at that time was to mass fire in the direction of the enemy.


  [1]: https://en.wikipedia.org/wiki/Baker_rifle
  [2]: https://en.wikipedia.org/wiki/Rifle_Brigade_(The_Prince_Consort%27s_Own)
  [3]: https://en.wikipedia.org/wiki/Girandoni_air_rifle
  [4]: https://en.wikipedia.org/wiki/J%C3%A4ger_(infantry)
  [5]: https://en.wikipedia.org/wiki/Brown_Bess