Question: why are ions attracted to electrodes?
Answer: This is because positive calcium ions are attracted to the negative electrode (cathode), where they gain electrons to form calcium atoms. At the same time, negative chloride ions are attracted to the positive electrode (anode).