In most cases when an underage person commits a crime, the legal punishment is imposed on their parents and there are no serious legal consequences for the child him/herself. However, in cases of more serious offenses, or repeated ones, more serious measures are called for - which is where juvenile correctional facilities come in play, functioning as a prison facility for juvenile delinquents (as the law refers to underage criminals). Juvenile correctional facilities are only used when the safety of the public with regards to the criminal cannot be guaranteed and they need to be locked up until their trial.
It should be noted that the idea of a juvenile correctional facility is not to serve as punishment to the juvenile delinquents, but rather as a more lenient correctional procedure - for example, inmates in juvenile correctional facilities have access to services like education, entertainment, healthcare, as well as constant counseling and programs designed to help them progress towards a crime-free life.
Juvenile correctional facilities can also be used as a stern warning to underage persons who commit acts which wouldn't classify as crimes if committed by adults, such as leaving their home without notice or drinking alcohol. In these cases, a full sentence isn't issued, rather the juvenile delinquent is locked up for a short period of time, normally less than 24 hours, in order to deter them from committing any crimes in the future. In this regard, juvenile correctional facilities have proved to be highly useful and provide great results.