Can some government/political law experts explain to me how it's legal for Kamala to just be made the Democrat nominee without an election?

Can some government/political law experts explain to me how its legal for Kamala to just be made the Democrat nominee without an election?

As far as I know this isn't Europe, where each party gets to choose their nominee. Isn't this what primaries are for? So the American people can choose which candidate will represent each party. She was in last place last election, and I guess we had primaries earlier this year, but she didn't receive a single vote. So how can the people in Washington DC just make her the Democratic nominee without holding an election? The politicians in Washington elected her, the American people did not elect her to be the Democrat candidate.

This seems completely illegal to me, but the lack of protests and outrage suggests to me, that I must've slept through this part of government class.

But even on Google, I couldn't find anything explaining how this is legal. It's like, no one is even asking this question.

Can someone who is knowledgeable in how our elections work please explain to me. Because clearly, I am missing something here.

Updates
1 y
So I did manage to find THIS article. The source isn't ideal, but she said it's because Biden dropped out and Kamala was the only Democrat who expressed interest in running, so there was no one else on the ballot.

news.unm.edu/.../q-a-law-professor-addresses-kamala-harriss-unprecedented-presidential-campaign
Updates
1 y
Reading the comments it seems like most people feel she is indeed an illegitimate candidate.
Can some government/political law experts explain to me how it's legal for Kamala to just be made the Democrat nominee without an election?
Post Opinion