When Mayella takes the stand, she immediately indicates that she is afraid of Atticus. Though he is simply cross-examining her, she is threatened by him and perhaps this is due to her feelings of inadequacy and insecurity as she knows her whole family is looked down upon around town. Because of this insecurity, she has trouble keeping her story straight, especially because it is somewhat obvious that she is not telling the whole truth.
As Atticus leads her along with his gentle questions, she further contradicts herself by suggesting that her father is not necessarily all that good to her or the kids when he's drinking but then blurting out that he's never touched a hair on her head. She cannot give convincing details about the way that Tom "took advantage of her" but she repeats over and over again that he did.
Mayella may in fact be very afraid of Atticus, but her testimony demonstrates her fear of many things, including her father and the perceived judgment of the town. All of this makes it difficult for her to tell a well-organized lie, as she can't even decide who to be most afraid of.