Tom Robinson is the black man accused of raping Mayella Ewell, who is white and very poor. Tom takes pity on Mayella and helps out around her house. The people in the courtroom are angered because Tom, as a black person, is legally, socially, culturally inferior and segregated from whites, with no moral or legal defense for breaking segregation laws.
Tom is being defended by Atticus Finch, and this trial is one of the major occurrences in the book, around which most of the rest of the plot revolves. One of the very sad things about To Kill a Mockingbird is the relationship between Tom and Mayella. They have always been kind to each other, and in both their worlds there was very little kindness. Mayella is nineteen; her mother is dead, and her father Bob is a drunk who lets Mayella do all the housework including trying to find ways to feed her six younger siblings.
Tom is older and married, but he is a black man in a culture that has very negative ideas about what a black man should be able to do. Tom's fatal mistake is that he takes pity on Mayella, and helps out around her house. Mayella offers him a nickel each time he does, but he does not accept. Mayella mistakes Tom's pity for something more. One day, she has saved up enough money to send all her siblings to town for ice cream, and tries to kiss Tom. Unfortunately for all concerned, Bob sees it happen. He accuses Tom of rape, and of beating Mayella (something Bob himself is guilty of). Mayella, in that culture, really has no choice but to join in and accuse Tom of rape. Atticus takes what he knows is a lost cause because it is the right thing to do.
On the stand, Tom tells the truth about why he helped Mayella--he felt sorry for her, he knew how hard things were for her, with no one to help her. The (white) people in the courtroom are more than uncomfortable--they are incensed. A black man (not the term they would use) is legally inferior and not culturally permitted to feel sorry for any white person. Tom also tells the truth about Mayella trying to kiss him, which angers the crowd because laws strictly segregated white women from black men. Despite the crowd being aware of Bob Ewell's character and treatment of his children, they psychologically reject Tom's actions, feelings and explanations.
Atticus proves that it was not Tom, with his lame left arm, who bruised the right side of Mayella's face--only Bob in his anger as a witness could have done that. Tom is found guilty anyway and lynched before his appeal can go forward. Unfortunately, as soon as Mayella was seen by Bob trying to kiss Tom there was not much chance of Tom surviving Bob's and Mayella's accusations.