At Chancellorsville, Lee confronted a Union Army of 130,000 with 60,000 men.
At Gettysburg, he had 70,000 men and the Union had about 95,000.
If he could reduce the Army of the Potomac's effectives by 30% after one battle with such great odds, he had good reason to believe he could have even more success on more even terms.
Lee's forces took almost 6,000 prisoners of war at Chancellorsville and had to let thousands of others go because they did not have the manpower.
Had he split Meade's army at Gettysburg, he could have done some absolutely brutal damage.
But say Lee had managed to badly defeat Meade at Gettysburg, would he have taken Washington or Baltimore? No. Had he won then he would do what he did following defeat, go home. What choice did he have? He was deep in Northern territory without a supply line. He would have had thousands of wounded to care for. He would have shot off most of his ammunition. He would have had the Army of the Potomac, wounded but still dangerous, in the area. He would have had no choice but to go back to Virginia.