Defense always wins. That's the lesson. In most of the great battles of the Civil War, Fredricksburg, Chancellorsville, Gettysburg, Antietam, Chickamauga, one side got there first, dug in, and awaited assault. The offensive side would give enemy lines as much artillery fire as possible, and then send the infantry forward. The new rifle-muskets of that year could reach out a couple of hundred yards and get hits. The assaulting infantry had to cover the last two hundred yards under accurate fire. In all cases, the defenders shot so many attackers down that they no longer had the numbers to win the hand-to-hand bayonet struggle for possession of the trench line. Pickett's Charge at Gettysburg is the classic example, but there were plenty of others.
Grant was the only Civil War general who seemed to understand this. Grant's decisive victories, Island Number 10, Shiloh, and Vicksburg were all won by maneuver, rather than bloody frontal assault.
This tactical lesson held true thruout WWI. Few European generals had read much about the US Civil War.