Short answer :
Basically, the Democratic National Committee (DNC) and Republican National Committee (RNC) rules state if a presidential or vice-presidential nominee were to drop out of the race before Election Day, the leadership of the parties would decide who replaces them.