Metonymy

A metonymy is a word or phrase that replaces the name of another word, which it is closely associated with. A metonymy adds flavor to a piece of writing by helping the writer sound less redundant. It addresses something in a more poetic and unique way. Authors can also add more complexity and meaning to ordinary words by using metonymy; furthermore, drawing the reader’s attention to what otherwise would not be noticed. This means bringing deeper meaning to simple objects or ideas. 
Example 1-
Marcellus: Something is rotten in the state of Denmark.
(Hamlet by William Shakespeare)
Shakespeare used metonymy in his plays and poems. This line from Hamlet: “the state of Denmark” is repeated throughout the book. It is meant to stand in for the whole royal system and government. 
Example 2- 
"The pen is mightier than the sword."
(Richelieu by Edward Bulwer Lytton)