Just to add to Don Cardi's excellent explanation:
If you are arrested for a crime in the US, our law requires that, within 24 hours, you must be "arraigned"--that is, brought before a judge. This is not a trial. The arresting officer and the prosecutor will explain the accusation against you. The judge's job is not to determine if you're innocent or guilty--his job is to schedule you for a trial and determine how much bail, if any, is needed. Often, if the crime is minor and you have no criminal record, the judge will let you "walk"--that is, leave the court without bail. If you fail to show up for the trial, he will issue a "bench warrant" for your arrest, and the police will come looking for you.
On the other hand, if the charge against you is serious, and you have a long record, the judge may deny you any bail at all. You will then be held in a jail until your trial is over. John Gotti was called the "Teflon Don" because he was found not guilty at all but one (the last one) of his criminal trials. What is often overlooked is that Gotti was at least twice held without bail until the trials were over--and he probably spent more than two years in jail even though he was acquitted.


Ntra la porta tua lu sangu � sparsu,
E nun me mporta si ce muoru accisu...
E s'iddu muoru e vaju mparadisu
Si nun ce truovo a ttia, mancu ce trasu.