A play on words, also known as a pun, is a literary device used to create humor or interest.
Puns are often silly. Scout uses a lot of figures of speech when describing her family history in the first chapter. She uses a pun to describe part of the venerable Simon Finch’s past.
If General Jackson hadn't run the Creeks up the creek, Simon Finch would never have paddled up the Alabama, and where would we be if he hadn't? (Ch. 1)
This pun emphasizes the fact that Scout’s family is old, and has been on the land a long time. Tradition is very important in Maycomb.
Another example of a pun is used by Scout’s father Atticus during the trial of Tom Robinson. The trial is about race, since Tom Robinson is black and accused by a white woman.
To begin with, this case should never have come to trial. This case is as simple as black and white. (Ch. 20)
The second part of that is the pun. You have probably often heard the figure of speech “it’s as simple as black and white” or comparing something saying it is black and white. It is clever to make the comparison when actual race is involved. So while this is a very serious situation, in Atticus’s closing statement to the jury during Robinson’s trial, Atticus makes a pun.
He is not exactly making a joke. What he is doing is reminding people that the case is really about race, and it really is as simple as that. Tom Robinson risks being convicted simply because he is a black man accused by a white woman (that is what happens). He is hoping to play on their sympathy.