Muskets weren’t used like modern rifles. In fact, trying to use them a bit like modern rifles got George Washington into a lot of trouble. One of the things George did at Valley Forge (besides starve) was he got his men properly trained in bayonet fighting. Back in those days, bayonets accounted for roughly a third of all battlefield casualties, so bayonet fighting was very significant. Bayonets weren’t the last ditch weapons that they are today. Once properly trained, in bayonets, military discipline, and other fighting techniques, George’s men could finally go toe to toe with the British.
In movies, you mostly see muskets used a lot like modern rifles. Effective use of military muskets meant using your soldiers like pikesmen. You lined up and charged. A massive group of guys charging with big long pointy things ends up being pretty darn effective in battle. They didn’t so much walk in step (which as the OP pointed out is a bit stupid), but rather they moved as a large group, and charged as a large group. This was so effective that before Valley Forge George Washington’s men tended to scatter and run the other way when the British got to the “charge them with the pointy things” stage of the battle.
Rifles were around back then, but armies for the most part used smooth bore muskets. The black powder they used would quickly foul the barrel. A round for a rifle needed to fit tightly in the barrel. If it didn’t fit tightly, you wouldn’t get any benefit from the rifling. After a few shots, the black powder would start fouling the barrel, making the tight fitting rifle round much more difficult to load. This dramatically slowed down your soldier’s rate of fire. The black powder also quickly obscured the battlefield, so that after a few shots the increased range of the rifle didn’t really buy you much. Military commanders of the time therefore favored the smooth bore musket, since its faster rate of fire was of much greater significance than the rifle’s longer range. Rifles did get some use by sharpshooters, but they weren’t used by regular troops.
The thing about a smooth bore musket is that it always fires curve balls. The loose fitting round is going to randomly strike the side of the barrel, which is going to make it spin in some random direction. The ball will go mostly straight for about 50 yards or so. After that, it’s going to curve, and you don’t know which way it’s going. It was commonly said back then that you could stand 200 yards away from a musketeer and not fear getting shot by him.
Movie muskets are always incredibly accurate at a distance, as long as the hero is the one making the shot. Heh. If you’ve got a smooth bore musket, you aren’t going to be able to hit the broad side of a barn past a hundred yards, no matter how good you are. A pistol is going to be even worse, due to its short barrel.
Another thing they never show in movies is the horrible misfire rate of flintlock muskets. Flintlocks misfire about one in every four or five shots. Movie flintlocks fire the first time, every time.
Watch this video, and pay attention to the last shot. It’s a misfire. The guy pulls the trigger, and click. He pulls back the musket, and then, when he’s not quite expecting it, it fires.
In the 1840’s, they invented the “minie ball”, which isn’t a ball at all. It’s a conical bullet with a hollow skirt. It’s smaller than the barrel, so you can load it even when the barrel is fouled. The skirt expands when the minie ball is fired, so it makes a nice tight fit in the barrel, increasing the power (very little blow-by) and imparting a good spin onto the round from the rifling. After the 1840’s, rifled muskets became the standard.
Here’s a pic of a minie ball:
A civil war musket using a minie ball is accurate to within a couple of inches at a hundred yards, and can hit a man sized target up to 400 yards away. Civil war muskets also use percussion locks instead of flint locks. Percussion caps reduced the misfire rate from about one in four to about one in a thousand.
I own and shoot an 1853 Enfield rifle-musket (it’s a reproduction, I wouldn’t shoot a rifle that was really 150 years old), so this is obviously a favorite subject of mine. Feel free to ask any musket related question and I’ll do my best to answer.