If you are a non-citizen of the United States who has been apprehended by the immigration authorities, and it's clear that you have no right to remain here or any realistic defense to removal (deportation), the next question is, under what circumstances will you leave? This question is an important one in terms of preserving any rights you might have to legally return to the U.S. in the future.
Your two main options regarding departure from the U.S. are likely to be:
An order of removal means that you have been found to have no right to remain in the United States. This decision is usually made by an immigration judge (IJ), following a hearing.
The most likely basis is that you are either inadmissible (fall into a category of people who the law says should not be allowed to enter the U.S.) or deportable (fall into a category of people who, despite possibly having had a right to be in the U.S., such as a visa or green card, have done something such that this right can be taken away; or who in the U.S. without permission (undocumented or illegal)).
If you are ordered removed, Immigration and Customs Enforcement (ICE) is required to physically remove you from the U.S. within 90 days from the date the judge's removal order becomes final. (See § 241(a)(1)(A) of the Immigration and Nationality Act (I.N.A.) or 8 U.S.C. § 1231.) If you've been found to have committed certain types of crimes, you will be held in detention, without bond or other pre-removal condition of release, during that 90-day period.
After removal, you will not be not allowed to return to the United States (you become "inadmissible") for a number of years. The exact term of your inadmissibility depends on the reason for which you were deported. Most people become inadmissible for ten years, but the term can range from five years to permanent (as is the case for aggravated felons).
Voluntary departure allows you to leave the United States within a certain time period on your own, rather than under a removal order. You have to actually ask for it, though. One can request voluntary departure either from ICE, assuming you're in contact with them (and even before you're in court proceedings) or from the immigration judge, either at the beginning or end of removal proceedings. It is described as a discretionary form of relief, meaning that an applicant is not necessarily entitled to it.
The law itself contains certain eligibility requirements, among them that people convicted of certain crimes cannot be granted voluntary departure. If you're in immigration court proceedings, it's easier to get voluntary departure at the beginning—in which case you give up all your other possible avenues for relief—than at the end. Even if you meet the basic eligibility requirements for voluntary departure, the immigration officer or judge is also allowed to consider whether you really deserve it.
The best thing about voluntary departure might be gaining the dignity of arranging for your own departure, without having to travel under the control of immigration agents. However, you also have to pay your own expenses, often starting with a bond to guarantee that you'll return home by the stated date.
Another supposed benefit of voluntary departure is that it does not lead to a period of inadmissibility based on a previous order of deportation. But this benefit becomes all but meaningless if you have already spent one year or more unlawfully in the United States, in which case you're subject to a separate ground of inadmissibility, which bars your return to the U.S. for ten years.
Oddly enough, if you obtain voluntary departure before you have been unlawfully present for one year, then you are not subject to the three-year bar on reentry that is normally triggered by unlawful presence of more than 180 days.
Before even considering the choice between voluntary departure and removal, make absolutely sure that you have exhausted all possibilities for staying in the U.S. legally. A lawyer can help you with this, and also help represent you in immigration court (removal) proceedings.