A metaphor is a comparison between two seemingly unlike things without using like or as. This is similar to a simile which is a comparison between two seemingly unlike things by using like or as. Common clichés can often be examples of a metaphor. For example, "that test was a piece of cake" is a metaphor. We don't mean that the test was literally a piece of cake. We mean that the test was easy. If I said "this bag is light as a feather" it would not be a metaphor but a simile because I used the word as. A metaphor is a more direct comparison than a simile.
Metaphors in literature ask us to find common threads between uncommon things. This search can often lead us to profound conclusions that we might have missed if the author simply wrote it all out for us. One famous metaphor that exemplifies this is "all the world is a stage and all the men and women merely players." If Shakespeare had written out his full meaning behind this metaphor, it might have taken an entire chapter. The metaphor is much shorter and allows the reader to seek out their own interpretation.