The prospect of another fairly close general election is not what Democrats were hoping for against Mr. Trump, but Mrs. Clinton will have a chance to widen the gap by winning over supporters of Mr. Sanders.

Mr. Trump, despite his gains, now finds himself at around 42 or 43 percent in national polls. He still trails Mrs. Clinton in the balance of recent surveys, even though she is facing a divided Democratic Party. She is in the lead, in no small part, because there are simply more Democratic-leaning voters than Republican-leaning voters in the country. All but one of the most recent surveys show that there are more Democrats than Republicans.

But Mrs. Clinton nonetheless struggles because of her inability to consolidate the independent-leaning, young, liberal supporters of Mr. Sanders. The most recent wave of national surveys shows Mrs. Clinton winning just 55 to 72 percent of Mr. Sanders’s supporters. She’s faring far worse among young and liberal voters than one would expect.

The good news for Mrs. Clinton is that there’s a lot of room for improvement. She could make gains after winning the nomination, much as Mr. Trump already has. That could leave her with a considerable advantage.