Why does Mayella Ewell lie on the witness stand?

Mayella Ewell lies on the witness stand because she is afraid of her father, Bob Ewell, and because she is humiliated by her own attraction to Tom Robinson. She tells the jury that Tom beat and raped her when, in fact, it was her father who beat her when he saw her hugging and kissing an African American. Her father told her what to say while on the stand and likely threatened to hurt her more if she refused. She told the jury what they wanted to hear, so it was an easy lie to tell. She lied to protect herself.