It's all spelled out in those statute books lining your lawyer's office. Exerienced lawyers refine the process to the point of knowing which county or district offers better court prospects, and which judge is likely to be more sympathetic to a client. Favorable settlements result from setting up a case in a positive way, and knowing how to align those elements can be crucial. Of course, should the case actually come to trial, the groundwork laid beforehand can determine success or failure. On the criminal side, similar considerations apply.
Legal expertise can make a difference at arraignments and bail hearings.
And because plea bargaining is common in criminal cases, knowledge of judges and procedures is a distinct plus in seeking the best possible sentence. There's a price for all this. Be sure to discuss the precise nature of the attorney's fee in advance. If your case is taken on contingency, wherein the lawyer collects only if you win the case, note that the one-third typically retained by the attorney usually does not include expenses. There's nothing wrong with shopping for an attorney.