Both techniques use multiple mechanisms for retention and separation. Please use a keyword search on the web or use Wikipedia for more general info (Electrophoresis & mechanism OR HPLC and mechanism). That way you can read and learn about the sections that most interest you.
HPLC it is a chromatographic separation technique consist of a stationary phase and mobile phase while Capillary electrophoresis is an electrokinetic separation technique (no stationary phase) just the buffer which known as Back Ground Electrolyte (BGE) The migration of the analytes is initiated by an electric field that is applied between the source and destination vials and according to the polarity of analyte and buffer separation occur