It is a transfer of the meaning on the basis of comparison. Metaphor can be based on different types of similarity:
a) similarity of shape: head (of a cabbage), bottleneck, teeth (of a saw, a comb);
c) similarity of function, behaviour: a whip (an official in the British Parliament whose duty is to see that members were present at the voting), a bookworm (a person who is fond of books);
d) similarity of colour: orange, hazel, chestnut.
A special type of metaphor is when proper names become common nouns, e.g. philistine – a mercenary person, vandals – destructive people.