This is the big thing. There are huge disparities in resource availability to prosecutors' offices to public defenders' offices. Last I checked, the national average is a 3:1 ratio in funding between prosecutors' offices and defenders' offices. That's just for the offices, mind; prosecutors' offices get ancillary and incidental support from police departments.
That means prosecutors' offices are better-staffed, better organized, and better supported. And, there's a substantial pay gap between prosecutors' offices and public defenders' offices. All of which means public defenders are understaffed, underpaid, and overworked for what they do, which degrades the strength of defense a public defender can levy -- while being a less attractive job that brings in lower-caliber applicants, and a lot of times that's new attorneys seeking law school debt relief because public defense qualifies for it.
That latter issue is especially noteworthy as it invokes the spectre of socioeconomics, generational wealth, and professional connections. A generationally-wealthy graduate from a high-tier law school, who graduated comparatively debt-free and could afford summer internship getting a good post-graduation CV and solid professional connections, won't need debt relief and thus will be less-inclined to seek civil service work while having a foot in the door for more-lucrative positions. On the flip-side, most graduates of modest means are going to have to seek civil service debt relief as their first priority for post-graduation employment.
In reality, public defenders are jobbers. Court's a zero-sum game; a 90%+ conviction rate means defense attorneys can expect a sub-10% success rate. That doesn't mean public defenders are out there throwing cases, it means public defenders are systemically crippled in their ability to represent defendants; or as Scalia put it in another context, one side gets to fight freestyle while the other has to follow Marquis of Queensbury rules. Most of the time, the best they can do for the resources available to them compared to their caseload is to negotiate the best-possible plea deal.
There are no guarantors of success, but a high-priced legal team is certainly one of the things closest to it. Case in point, OJ Simpson.