A public defender is an attorney who works for the state and defends people who can't afford their own lawyers. If a defendant can afford to pay bond, it's harder for them to get a public defender.
When a defendant pays bail to avoid prison while their trial is underway, the court assumes they can also afford a private lawyer and don't need a public defender. It's still possible to get one, but the process can be complicated. In the US, the right to a public defender has been ensured since a 1963 Supreme Court decision. People deserve a strong defense, no matter how poor they may be.