What effect is made when Scout recounts stories that have been told to her but that she hasn't witnessed in To Kill a Mockingbird by Harper Lee, such as the story about Bob Ewell spitting on Atticus or about Atticus and Calpurnia visiting Tom Robinson.
Harper Lee's To Kill a Mockingbird is told from the perspective of Scout Finch, a very young narrator who, while she does manage to be in a lot of places, cannot be everywhere that the events of the story take place. So the author had to find ways to reveal information to Scout instead of through Scout in those instances.
The two you mention are great examples of that. When Bob Ewell spits in Atticus's face shortly after the trial, none of the children were present. Harper Lee uses the local busybody, Miss Stephanie Crawford, to relate the story to Scout, who then tells it to us:
"According to Miss Stephanie Crawford,... Atticus was leaving the post office when Mr. Ewell approached him, cursed him, spat on him, and threatened to kill him. Miss Stephanie (who, by the time she had told it twice was there and had seen it all—passing by from the Jitney Jungle, she was)—Miss Stephanie said Atticus didn’t bat an eye, just took out his handkerchief and wiped his face and stood there and let Mr. Ewell call him names wild horses could not bring her to repeat ...."
Unfortunately, Miss Stephanie is not a particularly reliable narrator (take her stories about Boo Radely, for example); however, we do get the story.
The reality is that having others tell stories to Scout about things Scout could not or did not see is simply an author's trick to make sure we're getting all the information. In another novel, one in which there is an omniscient narrator, the author does not need to employ this strategy; but since Scout is the storyteller Harper Lee chose, she has to utilize strategies like these to ensure that the readers are getting a complete picture. (Shakespeare did this all the time in his plays; at least in part because the Elizabethan stage was too small to stage great battles, characters often come from a fight or a battlefield or even just a murder and report what happened to someone else. The key characters never leave the stage but we all get the information.)
The effect of this strategy is that we get to see Scout process this information, but we also get to process it ourselves. When Scout tells us something tastes good, for example, we have no choice but to believe her. When she tells us that Jem got his ego bruised, we have to take her word for it--at least until we see him retaliate against her by pushing her too hard in the tire. When someone else tells the story, though, we get to form our own conclusions about what we hear.
When Dill tells Scout about what he saw when Atticus and Calpurnia went to tell Tom Robinson's wife that Tom was dead, we hear this:
“Scout,” said Dill, “she just fell down in the dirt. Just fell down in the dirt, like a giant with a big foot just came along and stepped on her. Just ump—” Dill’s fat foot hit the ground. “Like you’d step on an ant.”
Dill said Calpurnia and Atticus lifted Helen to her feet and half carried, half walked her to the cabin. They stayed inside a long time, and Atticus came out alone. When they drove back by the dump, some of the Ewells hollered at them, but Dill didn’t catch what they said.
As readers, we get to hear someone else's perspective on an event, in this case a young boy's view, and again we get to make our own judgments about what this moment must have been like for Mrs. Robinson. If Scout were our only narrator, if no one delivered these stories to her, we would lose all of these moments which add to the drama and power of the novel.