Kolbe's electrolysis method for getting alkanes
The metal does not play any role other than to form soluble salts here. The metal cations move to the cathode while carboxylate anions move to the anode where oxidation to a $\ce{R-COO·}$ radical takes place. These radicals decompose to $\ce{CO2}$ and $\ce{R·}$ radicals. Two of latter combine to form a C-C bond.