In some jurisdictions, like GA and NY, judges are elected. They accept donations to fund their election campaigns as do any other politicians. Law firms make many such donations. How can the judges maintain fairness in the face of such contributions? Are there limitations on such donations? For example, can a law firm with a case before a given judge donate to that judge's political campaign? If you have a case in such a jurisdiction, should you seek out the law firm that made the most and largest contributions?
Judges are people and as such they have all sorts of interests, relationships and beliefs outside the court room. This is true of appointed as well as elected judges. Indeed it is true of anyone exercising power in an official capacity weather elected like a politician or appointed like a civil servant.
When these impact on their actual or perceived ability to do their job this is called a conflict of interest. The correct way to deal with these is to declare them and, if the perception is such that the process will or may be seen to be, get someone else to do it.
For a judge this is called recusal and the judge themselves decides if it is necessary and gives reasons why it is or isn't. They may be asked to recuse themselves by one of the parties to the case or they may decide it is necessary to consider it on their own.
The decision of a judge to not recuse themselves is (like all a judge's decisions) subject to review through the appeals process. If the judge happens to be sitting at the top level (e.g. The US Supreme Court) and therefore not subject to superior court review is always part of a panel of judges and is subject to peer review.
For a judge to "be unfair", they would be acting contrary to the law, since the law reduces all matters to objective decisions given a set of facts. A judge does have the opportunity to act unfairly, and this could be because he favors a particular campaign contributor. More often this happens because he has an ideology which he allows to override the law. The system is reasonably self-correcting, and his unfair decisions will be overturned by higher courts if they are truly unfair. The other method of maintaining fairness takes place in a little under a month: a judge who has acted unfairly can be voted out of office: a judge can also be voted out if he is fair but unpopular.
The main problem is that "fairness" means a lot of different things to different people: usually it means "me winning is fair, me losing is unfair".