A figure of speech is a word or phrase that possesses a separate meaning from its literal definition. It can be a metaphor or simile, designed to make a comparison. It can be the repetition of alliteration or the exaggeration of hyperbole to provide a dramatic effect.
At its most basic, an analogy is a comparison of two things to show their similarities. Sometimes the things being compared are quite similar, but other times they could be very different. Nevertheless, an analogy explains one thing in terms of another to highlight the ways in which they are alike.