Although Jem only realizes later, this arrangement requires inner strength from both Jem and Mrs. Dubose. Jem must fight with his anger through all of the terrible, cruel things that Mrs. Dubose says about his father the Finch family. It is incredibly difficult for him to be polite to her under these circumstances, he aims to emulate Atticus, and so he keeps his anger under control. Through this he learns inner strength and understands what it is to be a man above anger, like Atticus.
Yet it is Mrs. Dubose who faces true punishment. She is forcing herself to fight her addiction to morphine, which requires great willpower and hidden bravery. This time with Mrs. Dubose becomes an important part of Jem and Scout growing up. Although she is antagonizing and cruel, through Atticus the children learn of her considerable strength of character. They also learn by her example the true meaning of bravery-beating a drug addiction, and having no cravings when she died. Thus, they have one final instruction in courage and grace before they have to actually practice those values.