The function of figurative language is comparing something to some other thing. It's imaginative and creative. There are some catogories of figurative language such as metaphors, similes, personification, alliteration, imagery, hyperbole, onamatopoeia, overstatements and understatements. It is how the figurative language is composed with. So think about something written without these components, and think of a novel.. Now you'll see the difference.
Figurative language enhances (by extending the meaning) the assertion of the idea of the writer.
"I'm so hungry i could eat a horse"
No one can ever perform such an act, but it is emphasizing the idea of the writer. The sentence implies the person is very hungry, through exaggeration. Figurative language is one of the most effective tools in a writer’s skill set. Learning to use figurative language is an important step in developing a mature and rich writing style.
So writers use figurative language for dramatic effect, to give more meaning than the simple words, cause it makes the writing more interesting to read.