Electroplating is an electrochemical process by which metal is deposited on a substrate by passing a current through the bath.
Usually there is an anode (positively charged electrode), which is the source of the material to be deposited; the electrochemistry which is the medium through which metal ions are exchanged and transferred to the substrate to be coated; and a cathode which is the substrate (the negatively charged electrode) to be coated.
Plating is done in a plating bath which is usually a non-metallic tank (usually plastic). The tank is filled with electrolyte which has the metal, to be plated, in ionic form.
The anode is connected to the positive terminal of the power supply. The anode is usually the metal to be plated (assuming that the metal will corrode in the electrolyte). For ease of operation, the metal is in the form of nuggets and placed in an inert metal basket made out non-corroding metal (such as titanium or stainless steel).
The cathode is the workpiece, the substrate to be plated. This is connected to the negative terminal of the power supply. The power supply is well regulated to minimize ripples as well to deliver a steady predictable current, under varying loads such as those found in plating tanks.
As the current is applied, positive metal ions from the solution are attracted to the negatively charged cathode and deposit on the cathode. As a replenishment for these deposited ions, the metal from the anode is dissolved and goes into the solution and balances the ionic potential.
In the case of materials such as gold, the anode is not sacrificial (gold does not dissolve easily !), but it is made out of material that does not dissolve in the electrolyte, such as titanium. The deposited gold comes out of the solution. Plating is an oxidation-reduction reaction, where one material gives up electrons (gets oxidized) and the other material gains electrons (gets reduced). The anode is the electrode at which oxidation occurs, and the cathode is the electrode at which reduction occurs.