I assume that you are talking about the episode in Chapter 15 when the mob of men comes to the jail. If that is what you are asking about, then the answer is that they come to the jail to lynch Tom Robinson. That means that they have come to kill him so that they do not have to take their chances with a trial. They want to take revenge on him themselves and they do not want to risk having him be acquitted in a jury trial.
They do not end up killing Tom largely because Scout defuses their anger by talking to Mr. Cunningham.
In the South back in the days of the Tom Robinson trial it was not uncommon for justice to be taken into the hands of an angry mob resulting in the hanging of a poor black man or boy. There was also very little consequences placed on the persons who would commit such a crime. The mob that gathered at the jail had this intention when they first arrived.
Atticus was well aware that the people would probably behave in this manner and that was why he was at the jail that night. Since the sheriff was not able to be there someone had to protect Tom from the mob. In the end, it was Scout's words that dismantled the mob.