Bail is meant to ensure the defendant returns to court; it may be refunded at the end of the case if all appearances are made.