Historian James M. McPherson:
“Even in his fighting from the Wilderness to Petersburg during the spring of 1864...Grant’s casualties were proportionately no higher than Lee’s even though Grant was fighting on the offensive and Lee’s soldiers stood mainly on the defensive behind elaborate entrenchments. Lee had lost as many men in Pickett’s assault at Gettysburg (and proportionately four times as many) as Grant did in the equally ill-fated June 3 Assault at Cold Harbor.”
The Confederates had to play a perfect game. Grant didn't. All he had to do was shove men into the meat grinder and eventually they would win.