Bail is an option for the courts to use to insure someone that might be a certain level of flight risk shown up to court.
It's not 100% necessity. People can be released on their own bond commonly referred to as a "personal bond" they don't pay anything and just promise to show up.
Has this bond system been abused as a form of oppression. Of course. We're human after all and there are corrupt shitty judges on the bench.
But for the most part the bond system does function.