For Gettysburg we have a Confederate Ordnance estimate that each man fired an average of 25-26 rounds. . . . these numbers seem to reflect the rounds presumed fired during the whole week in which the battle fell, by all 75,000 Rebel troops in the general area. If they are accurate, we can set them beside Union casualties of some 23,000 men and arrive at a figure of 81 shots fired to inflict each casualty, or maybe nearer to 100 infantry shots per casualty if we also count in the contribution of the artillery.
We find that Meade's 90,000 men were issued a total of 5,400,000 rounds at Gettysburg, giving an average of 60 rounds per man, although not all of these may actually have been fired. . . . If we estimate the overall average actually fired as lower than the number of round issued, we can guess that the average Union solider really fired only 40 rounds in the three days of the action. These calculations give a notional 180 rounds fired for every casualty inflicted by Federals, although this is without counting the artillery's contribution. . . . This is higher than the rather unreliable figures for the Confederate side, but consistent with the order of magnitude recorded for the Napoleonic Wars.This is from Paddy Griffith, Battle Tactics of the Civil War (2001). But you shouldn't imagine that contemporary soldiers are any better; automatic weapons allow them to fire thousands of rounds for each casualty inflicted. There is a great scene in Black Hawk Down in which a squad of American rangers patrolling Mogadishu blunders into a squad of Somali militia, and they proceed to blaze away at each other until their magazines are empty without hitting at thing.
It is just very, very hard to take careful aim when you are being shot at.