Kolbe's electrolysis method for getting alkanes It involves the electrolysis of "Sodium and Potassium salts of Carboxylic Acids". Why only Sodium and Potassium? Will some other metal like Li, Mg, Zn etc. not work? As long as the element is a better reducing agent than Hydrogen, won't our destination be attained? What is the role of the metal here?
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.