In To Kill a Mockingbird, Tom Robinson is not guilty of anything. He is accused, by Bob and Mayella Ewell, of raping Mayella. But it seems abundantly clear that Mayella and Bob are lying and that Tom is completely innocent of any crime. When Atticus questions Bob Ewell on the stand, he makes it clear to note that Mayella had a wound on her right eye and had wounds all around her neck. Therefore, it would be more likely that someone with two good working hands who is also left-handed was likely to be the attacker. Bob Ewell is left-handed with two good working hands. Tom has only one good working hand, his right, and his left hand is basically useless due to an accident with a cotton gin. Given the testimony and this evidence and the fact that it was well known that Bob beat his children, including Mayella, it is fairly clear that Bob was probably Mayella's attacker and that she conspired with Bob to blame Tom for everything, knowing that a black man in 1930s Maycomb was likely to get convicted in spite of any evidence that might suggest his innocence.
Tom gives his side of the story. He notes that he was trying to help Mayella because he felt sorry for her. The all white jury, with their racist conditioning, could not believe or accept that a black man could or should feel sorry for a white girl. Tom added that Mayella tried to kiss him. When he resisted, Bob Ewell happened to walk in and threatened Mayella, calling her a whore. In the end, the jury had Atticus' compelling logic (which pointed to Bob as the attacker) and beyond that it was Tom's word against Mayella's and Bob's. The jury let themselves be blinded by their prejudices and convicted Tom.
Discussing the guilty verdict, Atticus tries to explain to Jem why the jury convicted an innocent man:
“If you had been on that jury, son, and eleven other boys like you, Tom would be a free man,” said Atticus. “So far nothing in your life has interfered with your reasoning process. Those are twelve reasonable men in everyday life, Tom’s jury, but you saw something come between them and reason. You saw the same thing that night in front of the jail. When that crew went away, they didn’t go as reasonable men, they went because we were there. There’s something in our world that makes men lose their heads—they couldn’t be fair if they tried. In our courts, when it’s a white man’s word against a black man’s, the white man always wins. They’re ugly, but those are the facts of life.”