Throughout To Kill a Mockingbird, both Jem and Scout witness some very significant injustices, from the false accusation of rape and subsequent imprisonment and death of Tom Robinson to the malicious social discrimination of various "classes" of people (the Cunninghams, the Ewells, etc.) in Maycomb. They come face-to-face with some truly hideous acts of racism, sexism, ignorance, and violence; in the process, they are forced to grow up and develop moral consciences.
At the end of the novel, Scout and Jem barely survive the vicious attack of Bob Ewell, who tries to kill the children as revenge for Atticus defending Tom Robinson in court and "humiliating" the Ewell family by demonstrating that they are liars.
Thus, when Atticus puts Scout to bed at the conclusion of the book, we understand that despite the tumultuous events of the past two or so years, she is in safe hands. Scout still has a great amount of growing to do, and the presence of a parent can serve as a source of comfort at her young age. She will continue to evolve and thrive under the watchful eye of her good and patient father and will hopefully aid the rest of Maycomb in evolving into a more tolerant, peaceful place as well.