To cover his own crime and embarrassment of what transpired between Mayella and Tom Robinson, Bob Ewell and Mayella conspire together to accuse Tom Robinson of beating and raping Mayella. Although it is a case of Bob's and Mayella's word against Tom Robinson's (which, in a racist town, is patently unfair), the case itself is the state or town against Tom Robinson. So, Mayella doesn't really have a lawyer. She is a witness in this case. Mr. Gilmer is the prosecutor and he represents the state and/or local court in the case.
Mayella Ewell and her father, Bob, were the ones who brought the charges against Tom, so Mr. Gilmer, the prosecutor, was actually their attorney. Mr. Gilmer was the one who was to prove that Tom was indeed guilty. He had the easy job.
Atticus, on the other hand, was the one who had to prove to everyone that Tom was innocent. Atticus does prove this, but because Tom was a black man, accused of a crime against a white woman, he was bound to be found guilty. What Atticus does prove is that Tom is innocent and Bob is the one who was guilty of hurting Mayella.
Mr. Gilmer does his job. Tom is found guilty. Being the prosecutor, Mr. Gilmer was working for the state, yet he was also working for Mayella. He had the job of convincing the jury that Tom was the guilty party, and Mayella was innocent and had nothing to do with what happened. Living in Maycomb, his job was easy.
Mr. Gilmer is Mayella Ewell's lawyer. He is from Abbottsville. Scout describes him as a "balding, smooth-faced man, he could have been anywhere between forty and sixty". He had a slight cast in one eye, and used it to his advantage by pretending to look intently at either the jury or the witness while he was doing nothing of the kind.
The jury thinking themeselves under close scrutiny, paid attention; so did the witnesses thinking likewise.
He gives us a good insight into Southern prejudice. He demeans Tom Robinson because he is a Negro, and keeps on calling him 'boy', something that reduces Dill to tears.