Either the defendant is a threat to society or unlikely to show up at court (because he's a transient or likely to be issued a long sentence), then you lock up the fellow, or he isn't any of that, in which case one can trust him to show up on time. Also, isn't a person innocent until the judge pronounces the verdict?
What is sit that makes American society so different?
So the sixth amendment to he US constitution guarantees everyone the right to a speedy trial. Unfortunately, evidence takes a long time to prepare, and the trials themselves need to be scheduled based on available resources.
Technically when you post bail you're waiving your right to a speedy trial, and in exchange you can go about your business until the trial starts. The money is an extra incentive to show up - you lose it if you don't show. If you've done something particularly heinous, where the judge thinks you'll run no matter how much you have at stake, you won't be offered bail at all, and you'll sit in jail until the trial. I suspect in that case there's maximum amount of time they can keep you before trial, but I don't know what it is.
Since most people don't have a lot of cash handy they borrow the money from a business that specializes in such things, the bail bondsman. The bail bondsman gets his money back when you show up for trial, and if you run away he'll generally track you down and forcibly bring you back.
Yes, but resorting to arrest to bring you to trial after you've wasted the court's--and everyone else involved--time by not showing up has costs a risk of failure. Pretrial detention exists to eliminate that risk, and bail is in theory what you pay to get society to instead accept the risk and forego pretrial detention.