Mr. Underwood is an ironic man as the story continues. Watch him at the trial. Scout describes his ability to note every detail, which is likely what he was watching the whole time when they were at the jail that night. He was waiting for the right twitch or gesture to show that someone was going to attack Atticus.
Another irony of Mr. Underwood is this ability to print whatever he wants no matter what the people think of his work. As a racist, you'd think he'd print something negative about the trial. He doesn't. Just watch.
The quick answer to this is that Mr. Underwood had Atticus "covered" with his double barreled shotgun. This can be found right toward the end of Chapter 15.
As you say, the group of men is giving Atticus some trouble. Specifically, they want to take Tom Robinson out of the jail and lynch him. Attticus is trying to stop them.
It is interesting that Mr. Underwood helps Atticus out here. I say that because he is known to really hate black people and would probably not mind if Tom Robinson were killed.
In Chapter 15, Atticus has left home after supper under mysterious circumstances; he has gone out in the car with an extension cord and a light bulb. Jem decides to go out after him at almost ten o'clock. Scout and Dill tag along. They find Atticus in front of the jail attempting to keep an angry mob of white men from breaking Tom Robinson out and lynching him. The situation is quite heated, but Scout steps in and diffuses the tension by reminding the men that they are all friends and that Atticus has helped them in their times of need. Mr. Cunningham finally gives in to Scout's rambling discourse and agrees to tell his son, Scout's classmate, that Scout said "hey."
As the men leave, Tom Robinson, who has been completely silent during the whole affair, asks if the men have gone, and Atticus replies that they have and that they won't bother Tom anymore. Surprisingly they hear another voice "cut crisply through the night." It's Mr. Underwood, the owner of The Maycomb Tribune, whose home and office are right across the street from the jail. He says, "I had you covered all the time, Atticus."
Later, when Tom Robinson is shot trying to escape from prison, Mr. Underwood comes to Tom's defense again. In an editorial, he compares shooting Tom to killing songbirds--he insists it is "a sin to kill cripples." His article is written so that a child could understand it, and after reading it, Scout realizes that "in the secret courts of men's hearts Atticus had no case. Tom was a dead man the minute Mayella Ewell opened her mouth and screamed."