In my view, it boils down to the average person caring primarily about their own financial situation and being susceptible to snake oil sales tactics.
Trump is a despicable person and seems relatively unintelligent, but he is also a shrewd political salesman and recognizes the basic financial pain points that the average working class American is feeling. Even though he is vague on the details of how he is going to actually solve those things (purposefully so, because he doesn’t have any intention in doing that), he still constantly presses on those same basic pain points over and over again mixed with the right amount of racist and misogynist dog whistle rhetoric, until his messaging resonates with a majority of the electorate.
Contrast that with Kamala. By all accounts she seems like a decent person as far as politicians go, and is intelligent and as qualified on paper as anyone to be president. Unfortunately, her personality when she campaigns, makes speeches, debates, etc, comes across to a lot of people as corny, out of touch, and inauthentic. Would that really make much of a difference in the grand scheme of things in terms of how she would perform as president? I don’t think so. We’re talking about how to win an election though, and those type of personality traits matter a lot.
All of this stuff keeps bringing me back to Bernie Sanders. Throw out his specific policies for argument’s sake. When he was in the spotlight during previous campaign cycles, he seemed earnest in a genuine way, he understood the pain points of the average American, and he was concise and consistent with his messaging about he was going to solve those things. I think the Democratic Party desperately needs someone with that sort of personality to step up or they will assuredly keep getting pantsed in these elections.