Figures of comparison
Figures of comparison (or images) are one of the commonest 'permitted deviations' from the literal use of language -- when we seek to speak or write more vividly by making an imaginative comparison.
A great deal of slang is invented when one speaker’s imaginative comparison so pleases the listeners that they then adopt the word or phrase, which eventually becomes an accepted part of the language. The first person that said "He’s out to lunch" about another in the group with a vacant expression (someone who was "miles away", to use an older figure) said something very expressive and vivid. Others remembered it, and the expression spread until it is in danger of becoming a cliché (over-used expression). Indeed, it even led to the development "He’s out to lunch and he’s not coming back to supper", which indicates someone very far removed from reality. The similar expression of contempt "He’s two sandwiches short of a picnic" has spawned a host of similar comparisons – "two cards short of a full deck" and "two stairs short of the attic" are two that spring to my mind.
(Note that I said above imaginative comparison. Straightforward comparisons of a literal type – "This house is bigger that that one", "She is taller than her brother" – do not count as imagery. They are just comparisons – and not at all imaginative.)
Imaginative comparisons do not, of course, have to be contemptuous or insulting. When we say "She’s silver tongued", we are not claiming that one of the organs in her mouth is made of the metal that has the symbol Ag in the periodic table in Chemistry. We are saying that her speech is so smooth that it reminds us of that precious and attractive substance. That train of thought has also been developed in the proverb "Speech is silver, but silence is golden", which may serve to show how the figures of comparison work. Everyone knows what it means, but it is very hard to explain the precise sense of the words.