Lining up and shooting was the best way to use inaccurate muskets. One guy can’t shoot accurately at all, plus it takes lots of time to reload after each shot.
So you line up 20 dudes and have them shoot 5 or 10 at a time. That makes it more likely to hit something with each volley, and protects the guys who are reloading. The main skill for soldiers wasn’t aiming, it was reloading quickly.