Puns were used by Shakespeare to

explain historical background to the audience.
add humor or hidden meanings to a scene.
create a tone of confusion in his plays.
encourage audiences to listen more carefully.

add humor or hidden meanings to a scene.