Mail in ballots. Easy for Democrats to flood the mailboxes. And they probably engaged in illegal ballot harvesting. Only California allowed that. But it doesn't matter that the rules were broken.
The national Republicans wanted Trump out too. I think it was because he threw a monkey wrench into their influence selling.