Generally, engagement ranges in the 1700s to mid-1800s were about 50-100 yards. In theory, a ball from a smoothbore musket could be deadly (or at least dangerous) out to 300 yards, but the effective range was much shorter given the inaccuracy of the weapons.
Musket balls were smaller than the barrel (the technical term for this is "windage"), so they literally bounced down the barrel and left the muzzle tumbling off god-knows-where, rather than travelling in a nice, direct line to the target.
Before I get into detail here, I want to make one quick note. We tend to imagine troops up this period lining up in 2-3 ranks and delivering a single crashing volley. This happened quite a bit! However, many European armies of the 18th and 19th centuries used the “platoon firing” system. A battalion would be divided into “platoons” of 30-100 men. One platoon would fire, followed by another, and another. As one platoon fired, the others would be loading, readying, or recovering. This created a continuous, rippling fire. It also meant that different platoons within the same unit might open fire at different ranges. For example, the first platoon might fire while at an advancing enemy column was 100 yards away. By the time the last platoon had gotten its chance to fire, the enemy might be 50 or 60 yards away.
Officers had to make careful judgements about when to open fire. Opening fire at too long a range (i.e. over 100 yards) meant troops threw away their first, most effective volley for little gain. Well-led enemy infantry could shrug off this scattered fire as they advanced to closer range to then fire a deadlier volley of their own.
Although this wasn’t widely-discussed at the time, the lethality of musket balls also dropped very sharply and longer ranges. One medical historian writes about bullet wounds taken at Waterloo in 1815:
After 50 metres or so, the lead missiles lost kinetic energy, as they were heavy, round, and the loading and powder quality might have been substandard. Many injuries were thus caused by ‘spent’ balls.
Opening fire at too close a range could have even more disastrous consequences.The sight of oncoming enemy troops looming large could rattle men and make them miss. Holding fire until too late meant you lost the chance for a second volley at advancing enemy troops. A late volley also might fail to arrest an enemy charge. This was especially true for infantry being charged by cavalry. Even if a point-blank volley killed horses, it didn’t arrest the momentum of the dead animals, who got their revenge by smashing into the infantry. This happened more than once.
During the American Revolution, some British light dragoons got the better of some Continetals at the Battle of Waxhaws May 29, 1780. Daniel Murphy writes about the charge:
On command, the 17th [Light Dragoons] attacked [Colonel Abraham] Buford’s waiting infantry … for some reason, Buford’s men held their fire until the 17th was but ten to twenty yards away before they unleashed their volley. If Buford’s men had fired earlier they may have won the day, instead the result was a disaster.
At full charge a musket ball simply wouldn’t not stop a charging horse on a dime; the result was a wave of dying horses that came skidding, kicking and thrashing into the Continental line to blow it wide open. Tarleton later wrote that he suffered thirty-one horses killed and wounded, Buford’s tardy volley likely killed every horse in the 17th’s front rank: but the momentum of the horses carried them into Buford’s line, destroyed their order, and cost Buford the victory.
During the Napoleonic Wars, dragoons of the King’s German Legion (German troops in British service) achieved a similar feat at the Battle of García Hernández on July 23, 1812. North Ludlow Beamish wrote in 1837:
Captain Gustavus von der Decken, who commanded the third or left squadron of the regiment, seeing that if he advanced … his flank would be exposed to the fire of a dense infantry square, formed the daring resolution of attacking it with his single squadron. This square stood on the lower slope of the heights and obedient to the signal of their chief, the German troopers advanced against it with order and determination, while a deafening peel of musketry from the enemy greeted their approach.
Arriving within a 100 yards of the point of attack, the gallant squadron officer, struck by a ball in the knee, fell mortally wounded, and Lieutenant von Voss, with several men and horses, were killed ... the intrepid soldiers forced onward and bringing up their right flank, appeared before the enemy's bayonets on two sides of the square. The two front ranks, kneeling, presented a double row of deadly steel, while in the rear of these, the steady muskets of four standing ranks were levelled at the devoted horsemen.
At this critical moment, when the sword was about to be matched against the firelock, and the chivalrous horsemen against the firm foot soldier - when victory hung yet in equal scales - an accidental shot from the kneeling ranks, which killing a horse, caused it and the rider to fall upon the bayonets - gave the triumph to the dragoons!
For a path was now opened, and the impatient troopers rushing in amid the blazing fire, while men and horses fell fast before the muskets of the French infantry, their firm formation was destroyed, and the whole battalion were either cut down or taken prisoner.
The moral of the story? Fire when your enemy is close … but not too close.