Atticus is staying at the jail to protect Tom Robinson. When Jem and Scout go to the jail, Scout is the one that breaks up the mob that was there. Her innocence and friendliness makes the men go away. She isn't aware at the time, of what the men were about to do. Only when she returns home, does the reality of the whole thing, hit Scout. She breaks down and cries about the ugliness that she had just been witnessed to.
In all of her innocence, Scout looks at life with the childlike eyes she has. In that one instance, Scout is thrown into the reality of how the world works. She sees that the men could have easily have killed her father, and if given the chance, they would have killed Tom. Scout sees first hand the ugliness that is a part of her town. She is aware that there are some people that are just plain nasty. In her short life, Atticus has protected his children from the hatred he has to deal with, but by taking this case, he knows that the ugliness is sure to come to them.
Scout's world was changed that night. She no longer had the innocence of childhood, she now had the harsh reality of what hatred and ignorance could bring.