It is the unexpected intervention of Scout that stops the lynching party in their tracks. She goes to the jail that night only because she is following Jem, who, being older and wiser, senses trouble. Atticus is at the jail that night as he is aware that an attempt might be made on Tom's life. With characteristic courage, he has gone there alone, but he ends up getting unexpected help from his children. Jem, too, shows courage in facing up to the men, but it is Scout who really saves the day - most unintentionally.
This episode is at once tense and comical. The comedy springs from the fact that Scout is so uncomprehending of what is going on, but the tension arises from the fact that there is very real threat from these men. However, they are nonplussed by the sudden appearance of an innocent little girl in their midst and her embarrassment at finding herself among a bunch of strangers. She tries to make connection with them, finally lighting upon Mr Cunningham, father of her classmate Walter, the only person she recognizes. Her innocent reaching out to him has the dramatic effect of defusing the hostility of the situation. He responds in kind, and the lynching party breaks up, without having menaced either Tom Robinson or his protector, Atticus. Scout therefore inadvertently saves her father, brother, and Tom. It is not until later that she realizes just what she has done, and then she is overwhelmed by the seriousness of the situation which at the time she was so unaware of: 'The full meaning of the night’s events hit me and I began crying' (chapter 16).
We see in this episode, then, how even a mob set on murder might be disarmed. When Scout unwittingly appeals to Mr Cunningham's humanity, the men are no longer able to function as a mindlessly murderous group; they break up, and the danger is over.