President Lincoln suspended the writ of habeas corpus to maintain public order in restive areas. Restive areas are areas in which people are restless, unruly and often disobedient. Habeas corpus refers to a person's right to appear before a judge before imprisonment.
Suspending habeas corpus helped the Union win the American Civil War. Though several states on the border between the Union and the Confederacy were ostensibly members of the former, they often had large populations that sympathized with the latter. This situation made it difficult for President Lincoln to maintain order in those areas, which were necessary to supply the front with food, material and soldiers.
In April 1861, just after the beginning of the war, a mob in Baltimore had impeded the progress of Union troops, causing a violent riot. In response to this, Lincoln suspended the writ of habeas corpus, ignoring a judgment against him by the Chief Justice of the Supreme Court. A year later he suspended it throughout the nation to keep order at home while fighting the war in the South. That meant that Union generals could arrest and detain without trial anyone who was perceived as a threat to public safety.