Jem and Scout learn lessons from the trial that are without question some of the most harsh and brutal ones that they will experience in their young lives.
Both learn that while necessary, the justice system is fundamentally broken. When a prejudice permeates a society as deeply as racism does in the deep south, the jury system cannot effectively function because each and every juror will feel the same level of bias, making an unbiased jury impossible. This is absolutely devastating to Jem, who has been mentally preparing for the trial under the assumption that Atticus's defense will operate on a playing field that is purely based on logic. Atticus is like a god to Jem—he is morally upright and discerning, and he is a true hero. When Jem has to watch his father's best efforts crumble under the weight of systematic racism, it shatters him.
Scout, though more naive, has her eyes opened for the first time to the ugly nature of the general opinion in Maycomb. She is still only vaguely aware that she defused a lynch mob earlier in the story. By and large, she views adults as upright and civilized despite their differences. The trial is her first realization of how often justice completely fails in the wake of bloodlust.
The children learn a great deal from the trial. From its outcome, they learn that there is a very ugly side to Maycomb, one that is rooted in the racism of Jim Crow. Their notions of basic justice are proven to be illusions as the jury convicts Tom Robinson despite his obvious innocence. His conviction, in short, is based on the color of his skin. Jem is especially devastated by this realization. After the trial, Scout says:
It was Jem's turn to cry. His face was streaked with angry tears as we made our way through the cheerful crowd. "It ain't right," he muttered, all the way to the corner of the square where we found Atticus waiting.
Later he compares his realization to a caterpillar emerging from the safety of its cocoon, suggesting that for him, coming to grips with racism, and evil, more generally, is part of growing up. The injustice of the decision becomes complete shortly thereafter, when everyone learns that Tom was shot to death in an escape attempt from prison.
But the trial teaches the children something else. This is that their father is a good man, the type who nobly takes on a righteous cause even though he recognizes the consequences (and perhaps the futility of it). They are proud of Atticus, who grows to an almost saintly status in their minds. This is quite the departure from their attitude earlier in the book, where Scout describes Atticus as a sort of feeble old man. So in this sense To Kill a Mockingbird is as much about the maturation of two children as it is about the injustice of Jim Crow.
Jem and Scout both lose their childhood innocence after witnessing racial injustice firsthand at the Tom Robinson trial. Both the children learn that their friendly, hospitable neighbors are ugly racists who are willing to convict an innocent man simply because he is black. After witnessing Tom's wrongful conviction, Jem becomes jaded with his prejudiced neighbors. He is filled with an overwhelming sense of anger and complains to Atticus about Maycomb's insincere, prejudiced citizens. In contrast, Scout does not become jaded or upset like her brother. The Tom Robinson trial expands Scout's perspective, and she becomes aware of the overt prejudice throughout her community. Both siblings also learn from their father the importance of protecting innocent beings. Atticus's defense of Tom Robinson reveals his courage and demonstrates his integrity. Jem and Scout learn that in order to do the right thing, one must exercise one's courage and remain poised despite the surrounding adversity.
Before the trial the children discover that many of the townspeople are not happy that Atticus has decided to defend a black man accused of raping a white woman. They learn that Atticus was appointed to defend Tom, and that he had "hoped to get through life without a case of this kind." Inside the courtroom, the children see segregation in action: The Negroes in attendance must wait until all white people have entered before they can be seated--in the balcony. The children learn that what Atticus had said about the jury was true: That
"The jury couldn't possibly be expected to take Tom Robinson's word against the Ewells'." (Chapter 9)
Jem and Scout see what the jury is apparently blind to: That Tom's crippled left arm prevented him from committing the crimes of which he is accused. They also witness that Mayella Ewell contradicts much of her own testimony; that Bob and Mayella have no respect for the truth or for the respect of the court; that Tom is apparently a respectable and truthful man; and that the prosecutor shows no respect for Tom. Afterward, Jem is disillusioned with juries, believing that
"... can't any Chrisitan judges an' lawyers make up for heathen juries." (Chapter 23)
Both of the children wonder if Atticus has any real friends in Maycomb, but Miss Maudie assures them that Atticus was simply "born to do our unpleasant jobs for us." She also calls the jury's long deliberation "a baby step" toward better race relations.