When you draw an analogy between two things, you compare them for the purpose of explanation. The movie character Forrest Gump made a silly analogy famous: "Life is like a box of chocolates."
Some standardized tests still have "analogy questions," which are given in this format: A : B :: C : ___ (read "A is to B as C is to what?"). This is a more formalized version of something we do every day: compare one thing to another. It's a useful way of speaking — if a scientist explains that the earth's forests function as its lungs, we understand the analogy to mean that both trees and lungs take in important elements from the air. But when Forrest Gump says life is like a box of chocolates because you never know what you're going to get, that's a pretty brainless analogy.