Mechanism of formation and electrochemical performance of carbide-derived carbons obtained from different carbides