Alliteration is a literary device where consecutive words in a phrase or sentence begin with the same consonant sound, creating a rhythmic effect. It is often used in poetry, prose, and speeches to enhance mood, draw attention, or emphasize particular ideas. An example of alliteration is the phrase "Peter Piper picked a peck of pickled peppers."