You are referring to the events of chapter 15.
In Chapter 15, Atticus leaves the house early in the evening, as you said, to keep watch over Tom Robinson while he is in the Maycomb Jail. The trial starts the next day, and Mr. Heck Tate and others have warned Atticus that there may be trouble.
Jem is curious about what his father is up to, and he sneaks out of the house--Scout, of course, follows along. They stop and get Dill as well.
They find their father outside the jail and see several cars pull up and several men get out and approach Atticus. Atticus tells them to leave. The men basically refuse. Suddenly, Scout, Jem and Dill arrive on scene just as tension is flaring between Atticus and the men.
Scout recognizes Mr. Walter Cunningham, Senior...remember Walter Cunningham from earlier in the book? Scout beat him up and then Jem invited him to their home for lunch. It's his dad that's one of the men trying to get Atticus to let the "mob" have Tom Robinson.
It's clear the men want to kill/seriously injure Tom. They would rather see him dead than to allow him to have a fair trial.
But Scout unintentionally derails the entire conversation by addressing Walter Cunningham, Sr. In this scene, her naivitiy is shown--she has no idea that she's in danger, and she has no idea that what she's talking about is embarrassing to all parties!
Finally, Mr. Cunningham realizes his behavior is wrong, and he and the men get in the car and leave. No one is injured.
The best summary for Chapter 15 of the novel is available in the e-notes summary and analysis section as detailed below.
We are made very aware in this chapter of how the innocence of Scout reveals the ignorance of the mob members, and of how focusing in on the conscience of the individual is the best means of attacking oppression.
In this scene the men want Tom dead based on the ruthlessness found within their society and because of his race plan to kill him. However, when Scout appears, she differentiates Walter Cunningham singling him from the group which allows him to realize what atrocity he is planning to do. With Scout there Walter realizes what wrong he is about to commit and also how the mob mentality goes away. He realizes the wrong he is committing and makes everyone leave.