Imagine you train an algorithm to influence the voters to
win the election. What would be the objective ?
Maximize the probability that your candidate wins.
This does not imply winning the popular vote, nor maximizing the margin of the electoral vote.