Habeas Corpus is a fundamental principle of English Constitutional Law. It originated through the common law and was regulated by a number of statutes dating back to the Magna Carta, however its origins are somewhat archaic and therefore it is difficult to determine when or where it came from or how it came to be. It is still available to use in the UK today, and has been inherited by many places such as the United States and Australia. It has been used as a safeguard of individual freedom against arbitrary state action.
It is a Latin term, which basically means "May you have your body" or "You have the body". The writ of Habeas Corpus provides a remedy in cases of unlawful detention, where the detention is lacking sufficient evidence. The writ can be issued by the prisoner or by a third party acting on his/her behalf.
A writ of Habeas Corpus is essentially a summons, requiring the prisoner to be taken before court to see whether the persons detainment is legal. If the custodian does not have evidence or authority to detain the prisoner, an immediate release is ordered.
The Habeas Corpus Act 1969 guaranteed this right in law.
In 1772 there was a landmark case which invoked this right. James Somersett was a black slave who had been brought to the UK from Jamaica. He was freed after a debate brought by his demand for Habeas Corpus. Lord Mansfield had successfully argued for his release.
Habeas Corpus is rarely used today, and there have been multiple occasions of Parliament suspending the right. It was suspended in response to the French revolution, and again using DORA (The Defence of the Realm Act 1914) during WWI and also during WWII. The most recent was in response to the IRA in the 70's.
There was worry that the anti-terrorism legislation which was put into place over the last 12 years has curtailed the right to Habeas Corpus in the UK. Anti-terrorism legislation was put into place to deal with potential terrorist suspects where there is not enough evidence to prosecute, or when they are unable to be deported. Potential terrorist suspects can be detained for a certain period of time under these acts (I think it was 14 days, but I will have to double check).