In general through, judges have a strong bias towards the prosecution. DAs and judges are often extremely friendly since they work with each other every day. I would say that if you're innocent or your case has any extenuating circumstances, you almost always have a better shot with a jury than a judge.
Juries also allow for jury nullification, which allows for unjust laws to be ignored.
I dearly wish that jury trials were available in all cases. I recently went through a non-criminal case where justice was decidedly not served. The judge, of course, claimed he "had to follow the law" but his interpretation of the law contradicted the plain-text reading of the relevant statute. I had no choice but to suck it up unless I wanted to drop the rest of my life savings on an appeal. I feel pretty confident a jury would have seen things very differently.
The defence can ask a judge to throw out a case on the grounds that there is no evidence on which a jury could reasonably convict.
I think you're assuming quite a bit on the education, knowledge, and experience of the law on the part of the judge. There is no guarantee that the judge you get knows anything about the law pertaining to your case.
>> but their decisions have to be based in the law and either you broke a law or you haven't
And yet, judges are reversed all the time on appeal based on the idea that the judge got the law wrong.
Plus I'm fairly certain the judge has a great deal more power in the courtroom than the jury. A judge can certainly put you in jail for a period of time just because they feel like it.