The writ of habeas corpus is - like most legal items identified by a fragment of Latin - an antique. Indeed, it has some claims to be the oldest antique still functioning.
Historians claim the principles behind it were already established when they were mentioned in the Magna Carta, signed under duress by King John in 1215. Blackstone, who wrote his Commentaries on the Laws of England in the 18th century, cited an instance of the writ being used in 1305.
The Habeas Corpus Act, which first embodied it in statutory form, was passed in 1679.
The way it works is quite simple. If somebody mysteriously disappears from circulation and you think they have been arrested or detained by somebody, then you may at any time ask a judge to issue the writ. In urgent cases the application is even made by phone.
The writ itself is a court order requiring the person who has another in his custody to produce the prisoner in court and explain the legal basis for the detention.
The writ is rarely used these days, but its importance remains fundamental. The right not to be imprisoned 'except by the lawful judgment of his peers or by the law of the land', as the Magna Carta puts it, is a basic one. It has no meaning unless there is a procedure to safeguard it.