Scout had pity for Mayella because she realized she had a lonely and difficult life.
We are introduced to the difference between Mayella and her family when Scout comments that the only beauty in the Ewell’s house is Mayella’s flowers.
Against the fence, in a line, were six chipped-enamel slop jars holding brilliant red geraniums, cared for as tenderly as if they belonged to Miss Maudie Atkinson, had Miss Maudie deigned to permit a geranium on her premises. (ch 17)
Scout notices Mayella during the trial, and even though she should have a strong dislike for the girl because of what Mayella has put Atticus through, instead Scout feels sorry for her.
[It] came to me that Mayella Ewell must have been the loneliest person in the world. She was even lonelier than Boo Radley, who had not been out of the house in twenty-five years. (ch 19)
Scout notices that when Atticus asks Mayella if she has any friends, she does not know what he means. Mayellla leads a lonely life, and the only person who was ever “decent” to her was Tom Robinson, and she had to betray him because her father found out she kissed him.
Scout’s pity for Mayella demonstrates that she is growing up. She is learning empathy. She not only has empathy for Boo Radley and Tom Robinson, she also has empathy for Mayella. It takes real strength of character for Scout to look at Mayella and see sorrow.