This is a great question. On a superficial level, To Kill a Mockingbird seems like two different books, but in the end it all comes together.
On the one hand, Atticus is fighting injustice by defending Tom Robinson, a black man who is wrongly accused of a crime. On the other hand, there is a mysterious figure, Boo Radley, by whom Jem, Scout, and Dill are fascinated.
It all comes together in a strange turn of events. Even though Tom Robinson was charged as guilty, Bob Ewell felt shamed in court. For this reason, he hated Atticus. In fact, Bob spit on his face. Atticus thought that this was the end, but in the end of the book, Ewell came after Scout and Jem to harm them. This is when Boo comes in. For some reason, Boo sees what is happening and he prohibits Bob Ewell from harming the children. In the process, the children are saved, but Bob dies from a knife wound.
At the end, Atticus and Heck Tate decided to confirm a story that Bob fell on his knife. In this way they could protect Boo from the public eye. Boo was a recluse. By doing so, Atticus is able to save one mockingbird, Boo, a misunderstood man, who never harmed a soul. So, even if he was not able to save Tom, he did save Boo.