How to bail bonds work in a criminal case?

How to bail bonds work in a criminal case?