Transference of name based on similarity or likeness is called a metaphoric change of meaning (metaphor).
Metaphoric transference may be based on: similarity of appearance, position, movement, sound, etc.
Metonymy is the transference of name based on contiguity.
Metonymic transference may be based on: using the name of a receptacle for its content, using the name of a place for its inhabitants, using the name of an instrument for its function or its user, etc.
The study of the semantic changes of the word shows that they occur in accordance with the development of human thought and society and serve the purpose of communication.