Since most of the fighting happened in the South, the North’s war machine was never imperiled.
I wonder if the South had won at Gettysburg, and had continued success on Northern soil, would the Union lost its will to fight.
"Gettysburg" by Newt Gingrich and W. Forstchen dealt with that "what if", and it only would have delayed the inevitable - for the same reasons Germany and Japan could not have won - finite industrial base.
Win Gettysburg? That was never in the cards Longstreet knew it and spoke up about it. Lee knew but the pressure to end the war was to great on him. The war was always about who could pour the most resources for the greater length of time.