Answer :
The North had superior numbers in superior position (high ground).
IMPROVEMENT
The causes of the Confederate defeat were many:
1 - Gen. Stuart's Cavalry Corp failed to join Lee's Army on the battlefield, thus depriving Lee of vital information about the movements of the enemy units.
2 - The battle broke out before Lee's could deploy all his units as planned.
3 - The Confederate failed to capture the Little Round Top on July 2nd
4 - Despite the adverse and well grounded advice of Gen. Longstreet, Lee was inflexible in planning the great charge against the Union center carried on July 3rd.
5 - During the artillery preparation for this decisive attack and the resulting duel of artillery (150 Confederate guns were concentrate against the objective and 103 Union guns were ready to carry the counter-battery fire), the Union artillery commander of the menaced sector, Gen. Hunt managed to deceive the Confederates about the outcome of their bombardment ordering a reaction by an intermittent fire carried on by only some 80 guns, giving the impression that the Union artillery were being gradually overwhelmed and put out of combat. The trick worked well and the great charge started, being the Confederate convinced that it would met but only a weak standing barrage fire.
6 - During the last stage of the battle Stuart's Cavalry Corp attempted to attack from the rear the Army of Potomac, but was repulsed by the Union cavalry units.
If any two of the above results could have been reversed, the Union victory may not have happened.