Broadly speaking, all figurative language can be called metaphorical; see Literal and figurative language. The more common meaning of metaphor is a figure of speech that is used to paint one concept with the attributes normally associated with another. "X is a metaphor for Y" means that Y is painted with the attributes of X.
All metaphors can be analyzed and reduced to the equation "X equals Y." Most music lyrics contain a metaphor or two, such as Stevie Wonder's, "You are the sunshine of my life," is the equation girlfriend = sunshine, something that's impossible unless she becomes a ball of nuclear fusion. Or when Elton John titles his song, "Candle in the Wind," Marilyn Monroe = snuffed out; he later re-wrote the song to "Goodbye English Rose" making the new metaphor Lady Diana = rose.
We can find more examples in everyday languge. "Life in the fast lane" (life = speeding auto) or "bowels of the ship" (ship = animal) or "drowning in money" (cash = water) or "beating your head against the wall" (wall = problem and head = solution) or "he's still wet behind the ears" (grown man = newborn baby) or "Luca Brasi sleeps with the fishes" (Luca = dead).
In political discussions, for example, a ship is often taken as a metaphor for the state; thus people speak of a "ship of state". This metaphor likens the government to a ship: just as a ship needs a captain to make decisions, give orders, and control things, so a government needs someone to make decisions, give orders, and control things. By referring to the ship of state one emphasizes this aspect of government.
Metaphor is usually distinguished from simile. Both compare two seemingly unrelated objects, but, in the latter, the comparison is made more explicit, usually through the use of the words "like" or "as". "Life is but a dream" is a metaphor, for example, while "getting money from him is like pulling hen's teeth" is a simile.
Metaphor is one of the most common figures of speech and many words have their origin in metaphor. When a metaphor is so common that people usually take it for granted, it is called a dead metaphor. Understanding, for example, is a dead metaphor, having its origins in the idea that "standing under" something was akin to having a good grasp of it (another, slightly less dead metaphor) or knowing it thoroughly.
Metaphors are seen as very powerful tools because they allow for the expression of abstract principles by reference to concretes. They can also be dangerous to understanding, in that people may fail to recognize the figurative nature of a metaphor, and come to take it literally.
On the other hand, since so many, many words are dead metaphors, attempting to avoid them entirely would end in silence. For instance, consideration is a metaphor meaning "take the stars into account", mantel means "cloak or hood to catch smoke", gorge means throat, and so forth for thousands more.
The mixed metaphor entails using two living metaphors in obvious conflict, such as: "That wet blanket is a loose cannon"; "Strike while the iron is in the fire"; or (said by an administrator whose government-department's budget was slashed) "Now we can just kiss that program right down the drain". On the other hand, to refer to a photograph enlarged too much as "a grainy shot" is not a mixed metaphor, even though both the grain and the shot were originally metaphorical.
Many consider metaphor to be at the heart of poetry (or even to define in part what it means to be human): the figure of speech that links dissimilar objects for their resemblance. For example, Emily Dickinson uses "the white assassin" as a metaphor for frost. Ground may have a blanket of snow where blanket is a metaphor for cover.
Originally, metaphor was a Greek word meaning "transfer". The Greek etymology is from meta, implying "a change" and pherein meaning "to bear, or carry". Thus, the word metaphor itself has a metaphorical meaning in English, "a transfer of meaning from one thing to another".