This is a good question. If Scout was not present, I believe that the mob would have not only killed Tom Robinson, the mob would have also seriously hurt Atticus and maybe even killed him.
When Atticus confronted the mob, he was not getting anywhere. It was only when Scout came to Atticus that the mob dispersed. The reason for this is twofold.
First, Scout showed that Atticus was not just a man, but also a beloved father. The men in the mob probably thought about their own families. Mr. Cunningham probably did, as Scout specifically mentioned that she knew Walter.
Second, they saw the innocence of Scout. In other words, when you see innocence and purity, evil motivations become exposed simply by way of contrast. So, when Scout and her innocence was on stage, the men felt shame. Their madness subsided; they were able to see what they were about to do. Here is what Atticus says:
“So it took an eight-year-old child to bring ‘em to their senses, didn’t it?” said Atticus. “That proves something—that a gang of wild animals can be stopped, simply because they’re still human. Hmp, maybe we need a police force of children... you children last night made Walter Cunningham stand in my shoes for a minute. That was enough.”