Why does the primary margin of victory seem to indicate who’s going to win the general election? Partly because presidents and their vice presidents almost always cruise to the nomination. Obama had no real challenger in 2012, for example. After all, primary voters aren’t likely to turn away an incumbent who looks like he’s going to win the general election. On the other hand, incumbents who do have trouble in the primaries — like Gerald Ford in 1976, Jimmy Carter in 1980, and George H.W. Bush in 1992 — go on to lose.
The primary margin may also provide some information about candidate quality. Many political science models (see Emory University’s Alan Abramowitz’s for one example) simply do not account for who is running. That’s partly because it can be hard to come up with tangible definitions of candidate quality. Voting results from the primaries are quite tangible, however, and they may provide some evidence that candidate quality matters.
It’s also possible that a longer nomination process can leave a candidate damaged, say by draining her funds or forcing her to take positions that do not appeal to general-election voters.