Scout understands that Mayella has no friends and spends a lot of time isolated.
Scout notices that Mayella is lonely when she hears her testimony because she realizes that Mayella lives an isolated existence. She is lonely and has no friends. She is surrounded by brothers and sisters, but has no one her age to talk to and no mother to talk to. As she testifies, Scout realizes how alone she is.
She was even lonelier than Boo Radley, who had not been out of the house in twenty-five years. When Atticus asked had she any friends, she seemed not to know what he meant, then she thought he was making fun of her. (Ch. 19)
During the trial, Scout is at a time when she is beginning to mature and become her adult self. As she comes of age, she is starting to understand what her father said when he told her that she needed to see things from other people’s point of view in order to understand them.
She is not normally inclined to empathize with Mayella, since she is on the opposing side of her father who is defending Tom Robinson. However, she is also able to listen to Mayella’s sad tale and realize that Mayella is lonely, and feel like she is the loneliest person in the world. This realization is a demonstration that Scout is growing up.
Scout’s revelation, and the fact that she points it out to the reader, is important. It helps the reader understand why Mayella might have accused Tom Robinson, or how she got herself into the situation in which she might have found herself needing to accuse him. It also helps the reader empathize with her when we otherwise might not, since we would tend to side with Atticus.