Most materials are made of two or more substances that are locked together with chemical ‘glues’. A rock, for example, is made of many substances locked together. Electricity can break materials apart and release pure metals.
It is also possible to use electricity to get metals to form a thin, even coating over other materials. This is called electroplating.