What really happened that fateful night is that Mayella Ewell was lonely, and Tom Robinson was young, strong and attractive. She wanted him to kiss her, because she was falling in love with him. Her father caught them, and she made up the story about being raped to avoid her father’s wrath.
Mayella Ewell was nineteen years old and very isolated. Her mother was dead, leaving her alone on the outskirts of town by the dump with a lot of children to look after.
Atticus was quietly building up before the jury a picture of the Ewells' home life. (ch 18)
Bob Ewell testifies that he was coming home and heard Mayella scream, and found Tom Robinson raping her. He stopped Robinson and he ran away. Yet by his own testimony he never called for a doctor. He called the police.
Atticus establishes that it was the right side of Mayella’s face that was beaten up. Since we know that Ewell is a violent man, and we know that Tom Robinson is crippled, it is more likely that Bob Ewell found her kissing Tom Robinson and hit her for it.
It makes more sense to take Tom Robinson’s word over Mayella’s, because she and her father are clearly lying. Nothing they say is backed up by the facts.
"She reached up an' kissed me 'side of th' face. She says she never kissed a grown man before an' she might as well kiss [me]. (ch 19)
Robinson admits that he felt sorry for her, and that’s why he kept coming to help her. Feeling sorry for her is what got him convicted, because it was not appropriate for a black man to feel sorry for a white woman, even one as pitiful as Mayella.