California has “employment at will” which means the employer does not even need to give a reason for terminating somebody.
Of course that doesn’t mean former employees won’t try—race, color, age, sexual orientation, physical/mental disabilities might be alleged.
Employers are advised by their HR departments to document, document, warn, document, etc.
Counsel them for being late/tardy/using company equipment for personal use (Surfing), etc. Then catch them in the act and fire them. ALL OF IT IN WRITING!