Pretrial detention/Bail

Explain pretrial detention and the concept of bail in 270 words. APA format w/references.