Why are "lynching" and the Ku Klux Klan mentioned in the book, To Kill a Mockingbird?
Lynching is classified as a group of people kidnapping a person to hang them as a punishment (usually occurs to black people).
Historically, the Ku Klux Klan was an active organization at the time To Kill a Mockingbird was set. For African Americans living in the South during the 1930s, the KKK was a very real and present threat.
During the course of the novel, the small town of Maycomb seems remote and small enough to be protected from the actions of the KKK, however, Harper Lee likely mentions it for a couple of reasons. The fact that townspeople have any knowledge at all of the KKK gives evidence to its presence despite Maycomb's small size and distance from the nearest large city. Second, consider the mob scene in chapter 15. Though these are simply townspeople, their actions (threatening Atticus and Tom Robinson, dressing to cover themselves despite the heat, dispersing once they are recognized, etc.) parallel the actions of the KKK.
The use of diction such as lynching makes real the threat of brutal violence such as was historically committed by the KKK and adds a very serious element to the tone of the novel. Despite the humor, the playfulness in the story telling, and the fact that the main plot revolves around children, historically, Lee likely wants to remind her readers of the serious issues she is attempting to accurately portray. With the reminder of the KKK, the reader is instantly brought back to the grim reality that Tom Robinson was both facing and feeling as a result of a situation in which he was undoubtedly innocent.