Personification is a form of metaphor, a literary device comparing two things by applying the qualities of one thing to another. One famous example is the Walt Whitman line above.
Personification is a form of figurative language in which something that is not human is given human characteristics. This device is often used in poetry to enhance the meaning and beauty of poems.