| Modern bail can trace it's historical roots to English common law. Prior to the professional bail agents, people charged with crimes against the King were released pending their adjudication when others in the community would guarantee that person's appearance for trial.|
At that time, those providing the guarantee would face the punishment of the accused if the accused decided to flee justice. Thankfully, over time, this evolved into a system where property would be pledged as a guarantee instead of ones life and liberty. When society recognized it needed secure promises of criminals making their court appearances, the courts - both state and federal - developed a healthy history of bail law which to guide those those professional bail agents. (Many more of them women than you would ever expect.) For a fee, these career professionals provide the guarantees to the court. They become the jailer of choice of the arrestee, who pays for their fees. The individual taxpayer makes no contributions to the bondsman. In the suprisingly unlikely instances where the person fails to appear in court, the professional bail agent is responsible for rearresting the defendant and producing them in court.
Currently the bail system works in such a way that the criminal finances their own release from jail. They pay the bondsman to become their jailer of choice. They also have to provide substantial monetary guarantees either personally or through their family and friends that they will appear. This evolution has created a system where the jail space is opened up for more serious criminals. The criminals are held to answer for their crimes. All of this is done at zero cost to the taxpayers.