The Union troops attacked Petersburg hoping to cut off the Confederate capitol of Richmond. The first attack succeeded, but the commander didn't press his advantage and failed to take Petersburg.
A long siege ensued in terms both of time and distance. Troops built earthworks that stretched forty miles in some places. When you're driving in the National Park, you see unnatural hillocks throughout the forested land. They're the remains of the earthworks; the places where men fought, died, survived.
Petersburg is also the site of the Battle of the Crater. This was one of the most successful failures in military history. The explosion in the tunnel succeeded wildly, but the subsequent attack was a bloody disaster for the Union. Here are a few photos:
Opening to the tunnel Pennsylvania miners dug under Confederate lines.
Reproduction of the "Dictator" mortar the Union troops used to shell Petersburg.