Lee was on a roll. He had defeated a larger Union force in the Seven Days, and made them cower under the protect of Union gunboats in Jun 1862. He had trounced the Union Army at Second Manassa's. Even though greatly depleted by straggling, he had held his own at Sharpsburg in September, even though heavily outnumbered. He had a lopsided victory at Fredericksburg in December 1862. Outnumbered more than 2-1 at Chancellorsville, he had embarrassed the Union Army in May (while Longstreet and two divisions were away on Suffolk, Vir.
Lee had trounced the Union I, XI, and XII Corps on July 1. Badly mauled the Union III Corps on July 2 (and Wright's Georgia Brigade had, at one point, had made it to the top of Cemetery Ridge on July 2, but could not stay because he was not reinforced).
He was starting to believe his men could not lose.
There are some positions that cannot be taken with a frontal assault. That was one of them.
My great great grandfather was in Lew Armistead's Brigade of Pickett's Division. At sunrise, the brigade at 1,640 men. By sundown, it had 420 still in the ranks (including my GGGF). 1,220 killed, wounded, missing including General Armistead.