An overwhelming majority of GOP base do not want a president Hillary. This is why we have delegates to conventions. The delegates can choose a candidate that will win a majority in the general election. This is their job/purpose.
It is only a majority if trump gets 1237. The cruz/kasich vote will only happen if trump fails to get a majority.
Democrats have the same/similar setup. Delegates can pick Sanders because Sanders has better odds of winning the general election.