As I understand it as a foreigner, some/many Democratic primaries are decided by registered Democrats voting for their preferred candidate. While the vote at the general election might see most voters already decided, the candidates that get onto the general election ballot would be influenced by those that register with the party. Over time - and without forgetting the advantages of incumbency - this could skew the type of candidate that appears on the ballot with a D next to their name, and lead to candidates that even consistent Democrat voters might reject.