Answer:
1) General Lee wanted to get the Union Army out in the open in a Northern State & destroy them.
2) General Lee had plans to capture Harrisburg, the capital of PA. He was spread out & without contact with his main Calvary. He also planned on capturing cities like Philadelphia & Baltimore to force a peace negotiations.
3) General Lee wanted to get in between Gen. Meade & Washington DC, find some high ground & make the politcians in DC push the AOP to attack the entrenched ANV
4) General Meade was in pursuit of General Lee without Lee really knowing until the 29th-30th of June & Gettysburg had 10 roads in & out of town making it easy to maneuver a large number of troops. General Buford's Union Calvary was initially mistaken as local militia when Gen. Heth's Corps were going into town for supplies, etc.
Step-by-step explanation:
There are countless causes as to why the two armies clashed in Adams County, PA in July 1863. Once the battle started, Lee was dead set on an offensive campaign. If the AOP was driven out of PA into Maryland, it could have truly hurt President Lincoln's bid for reelection. The 4 above are generalizations & I could elaborate more, but those are some basics...