When you attribute human qualities to something that's not human—such as a creature, object, or concept—you're personifying.
Poet Carl Sandburg used personification in these lines of his poem "Summer Grass:"
"Summer grass aches and whispers / It wants something: it calls and sings." These verbs—aches, whispers, wants, calls, sings—are human qualities.
Annie Proulx uses personification in her novel The Shipping News to describe a character in a boat in rough water: "The swells came at him broadside from the mouth of the bay, crests like cruel smiles." The water becomes menacing in this description, as if it intends harm, through the personification
Writers use personification to bring life and familiarity to what they're describing. It can also create emphasis or make a moment more dramatic or interesting.