For cash bail, the money is returned if the defendant goes to all their court appearances. If they don’t show up, you will not get your money back.