Writs are issued by the Supreme Court to enforce the fundamental rights of Indian citizens, guaranteed by the constitution.
The power to issue writs is a provision under "Right to Constitutional Remedies".
Writ jurisdiction is enjoyed only by the Supreme Court and High Courts under Article 32 and 226 of the Constitution, respectively. A writ petition can only be filed against the State and not against private individuals or organisation. A writ is issued by the court, in general, against the State. Under their writ jurisdiction Supreme Court and High Courts issue appropriate writs in the nature of Habeas Corpus, Mandamus, Prohibition, Certiorari, and Quo Warranto.
Writ of Habeas Corpus:
This writ is used to protect individual's liberty. It is issued when a person is detained illegally and wrongfully. This writ can be filed before the court by any individual or organisation, not necessarily the aggrieved individual. This writ can be issued by the court both against the State and individual. Habeas Corpus literally means 'to have the body' i.e. physically producing the person whose detention is questioned before the court in order to enable the court to ascertain the grounds of detention. However, if all the material facts relating to the detention of the person are made available to the court, the court may not insist upon the physical production of detained person. When the court finds the detention illegal or unlawful, it will order the release of the person henceforth.
Writ of Mandamus:
This petition can be filed before the court only by the aggrieved individual. It can be filed only when the legal right of the person is violated. Private rights can't be enforced through the petition of Mandamus. It can be issued by a court only against a public authority or a person holding a public office. It cannot by issued against an individual or private organisation. It is issued when a public authority or officer is charged with a legal duty and he/she has failed to perform the duty which has resulted in the violation of a legal rights of the petitioner. Mandamus literally means 'command', therefore when it is issued it commands a public authority or officer to do or not to do something which is in the nature of his/her public duty. This writ can't be issued against President and Governors.
Writ of Prohibition:
This writ can be issued only against a judicial or quasi-judicial body and not against non-judicial bodies. This petition can be filed only by the aggrieved individual. This writ is issued when a judicial/quasi-judicial body takes up a case for hearing in excess or in absence of its jurisdiction. The purpose of the court is to prohibit the judicial/quasi-judicial body from proceeding further with the case. (Here judicial/quasi-judicial bodies could be lower courts, tribunals, for example.)
Writ of Certiorari:
It is similar to above writ in all respect except that it is issued after a judicial/quasi-judicial body has completed a trial of a case and pronounced it judgement/direction/order in excess or in absence of its jurisdiction. Thus the purpose of the writ is to quash or nullify the judgement/direction/order issued by such a judicial/quasi-judicial body.
Writ of Quo Warranto:
This writ can be issued only against a person holding a public office in order to ensure that a public office is not usurped by a person who is not qualified to hold the office. This petition can be filed by any person. When this writ is issued, it has the effect of removal of the person from public office with immediate effect.
E.g. U. N. Rao vs Indira Gandhi, 1971. In this petition the appellant had prayed that a writ of qua warranto be issued to the respondent, Smt. Indira Gandhi, and it be declared that the respondent has no constitutional authority to the office of and to function as Prime Minister of India. The petition was dismissed by the court and no such writ was issued against Smt. Indira Gandhi.