The year was 1863. The American civil war, fought by the Northern union army, and the southern confederate army, had reached a stalemate.
The location was Gettysburg, Pennsylvania.
The Confederate army was led by General Robert E. Lee.

Most of the war was fought in the south. But now General Lee decided to attack and take the fight to the north.
He moved his southern confederate army of nearly 60,000 men into northern (union) territory.
The plan was to destroy as many military installations as possible in Maryland and Pennsylvania, as the northern union army was in Washington D.C. defending it.

One key target was Camp Curtin, the largest military deport in the north. His intention was political, to cause mayhem in the north and thus discourage the northern population into losing faith in the war.
Without the backing of the population, and low morale of the troops, it is very hard to win a war.
This was the objective the southern confederate General, Lee, wanted to achieve in attacking the north.
As General Lee’s main army moved north, a skirmish erupted between two infantry units at Gettysburg. What happened was that another southern confederate general, General Heath had an infantry division at Cashtown and wanted to move to nearby Gettysburg to get shoes from a shoe factory there.

General Heath did this without foreknowledge about what was ahead of him at Gettysburg. He did not know that there was a northern union force there. Thus he run into the northern union infantry division and a skirmish broke out.
General Lee heard of the skirmish. The report said that a major northern union force was there. So, instead of sending a cavalry reconnaissance force to confirm the report, General Lee diverted from his original plan and ordered his entire army to mobilize and converge at Cashtown, a small village about seven kilometers from Gettysburg.
Soon General Lee’s 60,000 strong force of confederates (southern forces) began approaching Gettysburg from the nearby towns of Cashtown and Carlisle.
Meanwhile a much smaller force of 3000 union (northern) soldiers took up defensive positions at McPherson Ridge, a ridge which was between the town of Gettysburg which the northerners were defending and General Lee’s southern forces that were approaching from the towns of Cashtown and Carlisle.
The small northern union force of 3000 men were to hold back General Lee’s much larger army of 60,000 southern army until reinforcement could arrive from Washington D.C.
The northern union force tried to fight General Lee’s confederate army and hold it back, but since they were far outnumbered, they could not hold back the southern confederate force for long. So they withdrew to a nearby ridge called cemetery ridge.

This was a range of hills that formed the shape of a question mark. Cemetery ridge provided a very strong defensive advantage for the Union (northern) force. It was so good that when the Northern Union General Hancock arrived, he declared it the best defensive position that he had ever seen in his military career.

Since the union force was much smaller in numbers, and their reinforcement was slowly arriving, confederate General Lee (probably to take advantage of the union’s small force before reinforcements fully arrived) gave the order to attack. The order was not a clear and decisive one because he said “attack when you think it is practical” not “attack”.
The General receiving the order was confederate General Uele. General Uele did not think it was practical to attack and so didn’t. This is because General Uele knew that the troops were exhausted and wanted to rest.

This delay to attack gave the smaller northern union forces’ reinforcement time to arrive, strengthening their position further.
General Lee conferred with another of his fellow confederate Generals, General Longstreet. General Longstreet had other ideas. He wanted their confederate (southern) army to attack Washington D.C. This move would force the Northern Union forces occupying the strong defensive position of cemetery hill to leave that strong defensive position, come down, and pursue General Lee’s army that would be headed to attack Washington D.C.

General Lee’s army would then be able to fight the northern union army without the union’s advantage of the good defensive high ground of cemetery hill. They would thus be able to defeat the northern union army.
General Lee refused to attack Washington D.C. as General Longstreet’s suggested and decided (probably because of seeking honor and to show his strength and courage) to attack the union army where they were, on cemetery hill. This was despite the fact that cemetery hill was a strong defensive position, and it was suicidal to attack any force occupying it head on.
So General Lee’s Confederate (southern) army attacked cemetery hill head on. The fighting was fierce. But General Lee’s southern confederate army failed to dislodge the Union forces from their defensive positions. Despite heavy casualties General Lee kept attacking. They charged again and again head on but like a fly trying to fly through the glass of a window they were repulsed again and again.
General Lee’s southern confederate army was at a disadvantage. They were on lower ground attacking their enemy who occupied the high ground, cemetery hill which was perfect for defensive purposes.
General Lee’s soldiers were unprotected from the volley of heavy gunfire by the northern union forces that were dug in and well protected by their defensive lines and the high ground they occupied.
Finally General Lee’s confederate army was defeated amidst heavy losses. And so the southern confederate army lost the battle of Gettysburg.
This loss was one of the factors that caused the confederate army of the south to lose the American civil war.