It is a transfer of the meaning on the basis of contiguity. There are different types of metonymy:
a) the material of which an object is made may become the name of the object: a glass, boards;
b) the name of the place may become the name of the people or of an object placed there: the House – members of Parliement, the White House – the Administration of the USA;
c) names of musical instruments may become names of musicians when they are united in an orchestra: the violin, the saxophone;
d) the name of some person may become a common noun, e.g. boycott was originally the name of an Irish family who were so much disliked by their neighbours that they did not mix with them.
e) names of inventors very often become terms to denote things they invented, e.g. watt, om, roentgen;
f) some geographical names can also become common nouns through metonymy, e.g. holland (linen fabrics), Brussels (a special kind of carpets), china (porcelain).