The term "cause of action" is incredibly slippery. A court would say, "California follows the primary right theory of Pomeroy; i.e., a cause of action consists of 1) a primary right possessed by the plaintiff, 2) a corresponding primary duty devolving upon the defendant, and 3) a delict or wrong done by the defendant which consists in a breach of such primary right and duty." Got it? Neither do most judges or lawyers. The cause of action for a homeowner eviction is probably that the plaintiff bought the property after a trustees sale with proper notice and that the defendant refuses to leave after three-days notice.
To answer your second question, Code of Civil Procedure section 1161a allows unlawful detainer actions following foreclosure.