What is habeas corpus?
Habeas corpus is the legal idea that a person may not be held indefinitely without being charged and given a trial.
In some systems, a person can be held indefinitely without being charged. This essentially gives a government the right to imprison any person for any length of time without trying them. Habeas corpus prevents that. In the US, a person who is being held by the police can petition for a writ of habeas corpus. This compels the government to justify the detention of the person. It allows a court to decide whether the detention is legal. This prevents the government from simply holding people without charge.
Let me try to answer this one with fewer big words...
In our system of justice (we in the US got it from England), the government cannot hold you in jail unless it charges you with some crime. The government must also give you a "speedy" trial. There rules are meant to prevent the government from arresting you and then just letting you rot in jail without a trial.
If you believe that you are being held too long without being charged with a crime, you ask the court for this "writ." If they agree, they will order the government to either let you go or charge you.
Habeas corpus is a writ(order from judge) that compels a law enforcement authority holding a person in confinement to come forward and explain the basis of that confinement. Incarcerated individuals and their lawyers use this motion to challenge the constitutionality of the confinement.
If a detainee believes he is being held illegally, his lawyer will file a motion in the jurisdiction in which he is being detained. Then the Court(judge) will order the writ. When this happens the agency holding the person must bring him in person before the Court and his attorney.
Definition: Latin "you have the body" is a term that represents an important right granted to individuals in America. Basically, a writ of habeas corpus is a judicial mandate requiring that a prisoner be brought before the court and presented in flesh and blood to prove that that particular person is still alive. The individual being held or their representative can petition the court for such a writ.
According to Article One of the American Constitution, the right to a writ of habeas corpus can only be suspended "in cases of rebellion or invasion the public safety." Habeas corpus was suspended during the Civil War and Reconstruction, in parts of South Carolina during the fight against the Ku Klux Klan, and during the War on Terror.