So then how does the party decide whose name is on the electoral ballots?
Party rules control that. Usually, the parties formally select their candidates at a nominating convention, and that is usually partly controlled by primary elections and other operations run state by state.
But, if after the general election, a named candidate withdraws (and that is permitted), or becomes unavailable, the party has complete control over naming a replacement. The voters picked a PARTY, and a slate of party electors; not presidents or vice presidents. The names of the nominees typically appears on the general election ballots as a "convenience" to the voter.