The novel alludes to that war a few times: in Chapter 9 (which we'll focus on), in Chapter 13, when it's briefly mentioned that Maycomb was "ignored" during the war, and in Chapter 28, when we see kids wearing all kinds of costumes, including Confederate hats.
It's pretty clear that the allusion from Chapter 9 is the most important. Why is it there?
By drawing a comparison between the Civil War and the current conflict between Atticus and the townspeople who want to convict Tom unfairly, the narrator helps us understand, first of all, the full extent of the seriousness of Tom's case.
Through that allusion, we also understand how the sentiments that fueled the Civil War are still affecting race relations in the South when this story takes place. Racism is still alive and kicking, and it's just as ugly as it was during the Civil War.
Finally, as Atticus explains the difference between the real war and the current conflict, the allusion helps us see that the conflict between Tom's supporters (mostly just Atticus and his kids) and Tom's haters is serious and yet perhaps not serious enough to tear apart friendships or families, like the Civil War did.
For reference, here is the full context of that allusion from Chapter 9:
“Simply because we were licked a hundred years before we started is no reason for us not to try to win,” Atticus said.
“You sound like Cousin Ike Finch,” I said. Cousin Ike Finch was Maycomb County’s sole surviving Confederate veteran. He wore a General Hood type beard of which he was inordinately vain. At least once a year Atticus, Jem and I called on him, and I would have to kiss him. It was horrible. Jem and I would listen respectfully to Atticus and Cousin Ike rehash the war. “Tell you, Atticus,” Cousin Ike would say, “the Missouri Compromise was what licked us, but if I had to go through it agin I’d walk every step of the way there an‘ every step back jist like I did before an’ furthermore we’d whip ‘em this time… now in 1864, when Stonewall Jackson came around by—I beg your pardon, young folks. Ol’ Blue Light was in heaven then, God rest his saintly brow…”
“Come here, Scout,” said Atticus. I crawled into his lap and tucked my head under his chin. He put his arms around me and rocked me gently. “It’s different this time,” he said. “This time we aren’t fighting the Yankees, we’re fighting our friends. But remember this, no matter how bitter things get, they’re still our friends and this is still our home.”