Lee was a capable, gracious general who gave orders that were too vague and made bold, strategic plans that were unsupported by the tactical resources he commanded. As long as he had outstanding subordinates and gave them latitude to act as they saw fit, and while the South still had adequate economic resources, he did ok. After a while, the resources against him began to tell and mere generalship was insufficient to make a difference. The North had some brave, clever generals, too.
Whoever made up the Confederate plan at Gettysburg - or, should I say, lack of a plan - was not brilliant, and I leave it at that.
As for where the war was won, well, it was won at sea, and you can take that to bank.
Shelby Foote in his three volume set "The Civil War" does a commendable job of laying out the entire war--East, West and Maritime. He attributes to the surrender of southern forces at Fort Donelson in Feb 1862, the losses of Nashville/Middle/Western Tennesse and Kentucky from which the Southern Confederacy could never recover.
The loss of Kentucky by the North would have doomed Lincoln's administration and granted European recognition of the Southern nation.