Say the Confederates win the third day of the battle. Why does the war end?
The best scenario for this to happen is if Meade is forced to Surrender. If Meade surrenders then Lee's Army can take Washington, Baltimore and even Philly because their isn't a strong enough contingent of troops that can resist the whole of Lee's army.
How exactly is this supposed fantasy of a surrender by Meade going to happen?.
Lee is in no condition to besiege Meade and the Civil War was one in which the defense had superiority. At no point was Lee ever close to crushing the Army of the Potomac. While it is conceivable for Lee to have forced Meade to temporarily leave the vicinity of Gettysburg, he's still left with no viable option other than to do as he did after Sharpsburg and return home.Of course it is a very unlikely scenario and I discussed this in my previous post above, and at length on discord last night with Muaddib. My second post was based on the slim chance of this occurring but was not meant to be taken in isolation from the first.
Had one of the unlikely scenarios of breaking Meade's flanks and cutting off his lines of retreat or actually managing to break the center on day three (and yes, none of these were feasible for a variety of reasons), only then would scenario of Meade surrendering come into play.
You don't necessarily need to besiege Meade to force him to surrender. It is still possible to trap an army via maneuver though the window for such is rapidly closing by this point in history. The fact that Meade was very cautious and also preferred defensive strategy (much to the chagrin of Lincoln) eliminated most every opening for Lee to exploit to achieve this objective.
Moreover the defenses around Washington garrisoned by the XXII Corps were sufficient to keep Lee out of the Capital. Lincoln may have worried overmuch about the defense of Washington City, but not without reason. While the XXII Corps certainly could not have taken the field against Lee, they didn't have to. They only had to hold their own and were sufficient to that task.
Saving Washington and being able to win the war are very different though. A destroyed Army of the Potomac changes the game and while we from out vantage point understand how important the West was and to an extent so did Lincoln, many politicians and Congress saw Virginia as the main theater and the main place that the war had to be fought and won.
Lee did about as well as could be expected in his 1863 campaign. One way he could have done better would've been if the Army of the Potomac had dashed itself to pieces against a dug-in Army of Northern Virginia which I can't see a survivor of Fredericksburg such as Meade, or even Hooker, attempting.
The other would have been for Lee to keep the Army of Northern Virginia largely intact and conceded Gettysburg after the second day.
I pointed this out on discord last night as well, particularly in regards to Hancock who was also a veteran of Marye's Heights at Fredericksburg. This is particularly relevant to the whole lost cause emphasis on Jackson at Gettsyburg or Ewell pressing forward to Culp's and Cemetery Hill's. Had such occured, the Army of the Potomac would not have concentrated at Gettysburg. It also why any scenario short of Meade's surrender and/or the destruction of the Army of the Potomac would be a strategic set back for the confederacy with a campaign that Lee acknowledged was on borrowed time.
It is tempting to say here that campaign was unwinnable from the start, but the problem with that is it removes human agency from the equation. Whenever you have masses of troops moving around, largely blind and without knowing where the other guy is and what they are doing, you run that risk through a combination of human error and fog of war of losing what should be a winnable campaign. The Civil War is very close to modern war but it is just a few steps back and that is what allows for unexpected results.
A good example of this was Chancellorsville. The only way that Lee won that was because Hooker made a number of mistakes and poor communication across vast distances. Hooker had twice as many men and he was pressing him from two sides.