Cacophony, literally meaning "bad sound" in Greek, is a literary term that refers to jarring or unpleasant sound combinations in writing or speech. Writers generally avoid cacophonous sounds for the obvious reason that they are generally unpleasant to read. In poetry, however, there are times when cacophony can be used to produce certain emotional reactions in the reader, in order to describe a noisy situation, to convey a sense of discomfort, or simply to entertain by the use of unusual sound work.
The most obvious and literal use of cacophony in poetry is to mimic an actual loud, unpleasant sound. In this way, cacophony can be a form of onomatopoeia. Augusta Davies Webster does this in her poem "Circe," the opening lines of which describe an approaching storm that the speaker anticipates "splitting the shrieking branches" (line 13). The harsh-sounding "splitting" and "shrieking" both start with three consonants and have another strong consonant sound at the beginning of the next syllable. The line also deviates slightly from the expected rhythm of the poem — iambic pentameter — adding to the raucous, unruly sound of the storm.
Secondly, cacophony can be used to portray discomfort of some variety, whether the speaker's own discomfort or some unpleasant situation that the poem is describing. This use may overlap with the previous, since noisy situations may also be uncomfortable; but it may also be used to describe situations that are emotionally tumultuous. Gerard Manley Hopkins frequently does this in his Terrible Sonnets, a series of poems about religious doubt. In "Carrion Comfort," the speaker describes despair: "Scan[ning] / With darksome devouring eyes my bruisèd bones" (line 6). This line's cacophonous use of alliteration and its high number of accented syllables echo the speaker's own inner turmoil.
Sometimes, however, a poet might use cacophony simply for fun. Poets often use sound in unexpected ways in order to explore the limits of what language can express. This is especially common in children's authors such as Lewis Carroll or Shel Silverstein. Cacophony in the works of such authors may indicate loud noises or unpleasant situations, but just as often it may be an attempt to amuse and hold the attention of small children, whose ears might not catch more subtle sound work, but are receptive to cacophony.