Co-Electrodeposition Mechanism in Rechargeable Metal Batteries