In a word, firepower, both volume and accuracy. Refinements to weapons technology came into play by the mid 1800's, while field tactics (always slower to change than weapons tech) remained in the 1700's... at least until the high casualties were totaled up.
The standard soldier's sidearm by 1800, the flintlock smoothbore musket, had a low rate of fire, somewhat low reliability from the flint ignition (especially in damp conditions), and a fairly short effective range, as well as low accuracy. Effective range... 50-75 meters. This accounts for volley fire - one giant shotgun, which also made for a formation similar to the pike square formation that had been popular when pole arms were prevalent.
By the 1860's, the musket had evolved into the rifle - expanding bullets like the Mine Ball speeded up the reload, the percussion cap increased the reliability and also made for a faster reload. The rifles of the US Civil war: Springfield, Enfield, Richmond, etc... had a 200+ meter effective range,and were considerably more accurate than the musket. There was also the first practical sniper rifle, the Whitworth, with it's elongated bullet, that could be effective out to 1000 meters.
A few breechloading rifles with faster reload (that could be done lying down) were coming into use, such as the Sharps, plus the early Colt revolvers that made hit and run raids very effective. A very few Henry repeating rifles with the then new metallic cartridge made it into that war. These had minimal effect on that war, they were more a view into the future.
Artillery increased in both range and effectiveness. As opposed to the standard Napoleon, there was the Parrott Rifle, a rifled cannon with a reinforcing band around the breech, plus the 3" Ordnance Rifle that used stronger steel on the breech, both with a range of around two miles. More accurate, longer range, they could now target massed formations with a reasonable expectation of success.
The US civil war was a confluence of 18th century formations and tactics, with rapidly accelerating military technology, and the result was wholesale slaughter.
This carried forth into WW1, with the machine gun, aircraft, and very long range explosive artillery wreaking havoc on the massed charges that were attempted in trench warfare. The butcher's bill was correspondingly high.