In every presidential election, 37% of the electorate is guaranteed to vote Republican no matter what, 37% is guaranteed to vote Democratic no matter what, and the contest is thus decided by the remaining 25% of the electorate*. This principle has held true in all but two of the presidential elections to occur since the beginning of the modern two-party system**, and as such, the key to winning presidential elections rests in swinging the so-called Twenty-Fives.
There are several noteworthy characteristics of Twenty-Fives. First, they are generally unconcerned about ideological particulars. This isn't to say that they don't possess ideological convictions (all voters do); rather it means that, whatever the substance of their convictions, those aren't going to be the main factor in determining how they vote. Individuals who are primarily ideological in their outlook become consistent Thirty-Sevens due to a belief that whichever party they support is the one most likely to (within reason) implement policies consistent with their personal philosophy***. For Twenty-Fives, however, the only way ideology ever does influence their decisions is as a negative - while a liberal Twenty-Five is willing to vote for a reasonably conservative Republican under the right circumstances, and likewise a conservative Twenty-Five is willing to vote for a reasonably liberal Democrat under the right circumstances, both liberal Twenty-Fives and conservative Twenty-Fives get scared off when a Republican is perceived as too conservative or a Democrat is perceived as too liberal.
Instead Twenty-Fives are primarily concerned with (a) the perceived success or failure of the incumbent (whether president or just party) in dealing with the major issues of the day involving the economy, domestic questions, and foreign policy, and (b) the strengths or weaknesses of the leadership qualities that they see in the two major candidates, which can (but do not always) include a proactive attitude toward confronting problems, gravitas, charisma, integrity, sincerity, basic human decency, intelligence (without being an "egghead"), adherence to principle (without being inflexible), boldness (without being reckless), ability to compromise (without being pusillanimous), equanimity (without being cold), and effectiveness in "getting things done."
How do this rule impact the outcomes of presidential elections?
(1) When an incumbent president is seeking reelection, the election itself is almost always decided solely by (a). This is partially because Twenty-Fives generally place a higher premium on "state of the union" issues (i.e., the condition of the nation on economic, social, and international matters) than they do character or ideology, and in part because most of the opposing candidates have images that are neither so stellar nor so disreputable that they alone can make them either extraordinarily compelling or abjectly unelectable. As such, if a president is widely perceived as having done a satisfactory job on the major issues of the time, he will generally be reelected regardless of who opposes him; likewise, if he is widely perceived as having failed, he will be generally defeated regardless of who opposes him.
i. The only exception to this rule is when an unpopular president is pitted against an even more unpopular adversary and, as such, can exploit his opponent's weaknesses so as to win as "the lesser evil.". The most famous instance in which an unpopular president won due to the even greater antipathy of Twenty-Fives toward his opponent was when Richard Nixon, in 1972, defeated George McGovern despite being saddled with a deteriorating economy and a proliferation of scandals.***
(2) In elections when the incumbent president is not seeking reelection, the outcome still usually winds up being decided by (a) instead of (b), with the candidate representing the incumbent party benefiting and/or being harmed by the same set of (a) rules that would apply to him if he was the actual president himself (i.e., he'll win if his party's president is perceived as having done a good job and lose if the opposite is true). There are only three exceptions to this situation:
i. In elections wherein the sitting president isn't seeking reelection and one of the two major party candidates has an unusually popular image - and popular not within a specifically political context but above and beyond it - the abnormally popular candidate winds up winning regardless of the party label under which he is running. So far, this has only happened four times; on three of those occasions it was because the candidate was beloved for leading America successfully through one of its most traumatic wars (George Washington, Ulysses Grant, and Dwight Eisenhower), and on the fourth occasion it was because of the two major parties collapsed on its own (James Monroe, who benefited from the fall of the Federalists). Since we haven't had any wars on the scale of the Civil War or World War II, the likelihood of some such extraordinarily popular candidate arising is extremely small.
ii. In elections wherein the sitting president isn't seeking reelection and one of the two major candidates is unusually unpopular - and to an extent that is aberrant even in a nation that loathes its politicians as much as ours - the extremely damaged candidate winds up losing regardless of his party. So far, these inherently unelectable candidates have earned that reputation because they are perceived as ideologically extreme (William Jennings Bryan, Barry Goldwater, George McGovern) or because they are perceived as somehow unstable (Winfield Scott, Horace Greeley, Barry Goldwater). On rare occasions, bigotry can play a decisive role (Alfred Smith, the first Catholic presidential candidate); that said, issues of impropriety in a candidate's personal life have not been nearly as consequential as frequently assumed, with the sex scandals not harming candidates from Grover Cleveland in 1884 to Bill Clinton in 1992.
iii. Elections in which the overall public sentiment toward the incumbent party are neither especially positive nor especially negative (which can occur either because of a genuinely neutral assessment of the sitting president's performance or because it has positive and negative characteristics that essentially cancel each other out) wind up being decided on the basis of trivialities. This is not to say that trivialities don't play a role in all presidential elections, since they obviously do. However, elections which occur in the aforementioned circumstances are entirely decided by minutiae, whereas most others are usually only temporarily distracted by it. Because of this quality in their makeup, these elections can often be among history's closest; indeed, two of the last three elections that fell under this category were also the two closest elections of the twentieth century. The only time when these elections don't wind up being extraordinarily close is when one of the candidates has a campaign that, by conducting its strategy with unusually acute savvy and skill, winds up gaining a massive edge by exploiting trivialities in such a way as to accentuate real or imagined weaknesses in its opponent.
What can we learn from this rule?
1) Because the quality of the incumbent party's performance is by far the strongest variable in any presidential election, the much-mocked cliche is actually correct - i.e., the best politics is good government. As such, it is well-advised for sitting presidents or those running under the banner of sitting presidents to do everything in their power to solve the major problems addressing America at a given time. While this may seem obvious, history is littered with the remains of one-term presidents who lost precisely because they were afraid to do all that was necessary to govern well; more often than not, they were tethered either by the limitations of their own unshakable ideological convictions (Herbert Hoover) or, somewhat paradoxically, because they pursued "centrist" policies which they knew would be less effective but which they thought (mistakenly) would cause Thirty-Sevens from the other side to rally behind them (Benjamin Harrison, Jimmy Carter). It is also important to adequately promote one's achievements, as presidents who have racked up impressive successes often failed to be reelected because they did not spend enough time reinforcing to the public (and particularly Twenty-Fives) that they had done their jobs well (John Quincy Adams, William Taft).
2) Obviously, one should nominate a war hero (Washington, Grant, Eisenhower) if possible and avoid nominating someone rendered unelectable by perceived extremism (Bryan, Goldwater, McGovern) or perceived eccentricity (Scott, Greeley, Goldwater).
3) The net effect of the first two rules is that, all other things being equal, the outcomes of elections have very little to do with the strategies or characters of the candidates themselves. If the incumbent party is perceived as having been successful, it will usually win; if it is perceived as having been unsuccessful, it will usually lose. In these situations, the incumbent party has the advantage, since if it governs well and effectively promotes its own achievements it is guaranteed victory (although failure in this same area ensures the inverse). The opposing parties, on the other hand, have very little control over the outcomes; since rarely does a Washington, Grant, or Eisenhower come along, usually their best bet is to avoid nominating a candidate who is perceived as being ideologically extreme or unstable. Beyond that, the most they can do - and this can slightly help but rarely ever does much else - is choose an individual whose specific strengths are best tailored to the political needs of the time (such as picking a candidate with a reputation for honesty and reform during an era when corruption is the major issue, an "outsider" during a time of dissatisfaction with Washington, someone "experienced" when the emphasis is on "getting things done", someone with foreign policy experience during a period of international crisis, etc.)
4) There is only one type of election in which the individual actions and strategies of the candidates themselves (assuming that they aren't already unusually popular or unpopular individuals) can determine the outcome - i.e., the ones described in 2iii, wherein the popular verdict on the incumbent party's performance is more mixed and neither candidate is inherently popular or unpopular. As mentioned before, in most situations those elections wind up being very close both because of their intrinsic lack of any decisive qualities and because neither of the major candidates do anything to significantly change the dynamic of the election. On two of the three occasions in the last century when that type of election occurred, the outcomes wound up being among the closest ever - Kennedy vs. Nixon in 1960 and Bush vs. Gore in 2000. The one occasion in recent history in which a presidential campaign of this type wound up being lopsided was in 1988; in that year, the strategists working for George H. W. Bush got him elected by assaulting their opponent, Michael Dukakis, on so many trivial issues that what would otherwise have been a close election wound up going decisively to Bush. 1988 remains the only election in recent history in which a campaign strategy actually effected the outcome.
And now to all of the asterisks...
* - Third-party candidates usually divide up the remaining voters, whom I will call Ones due to their tendency to support individuals who receive 1% or less of the popular vote. That said, even on a rare occasion when a third-party candidate receives an unusually large number of popular votes, that candidate still has not managed to deprive the two major parties of their 37% (with but two exceptions).
** - The modern two-party system was born during the presidential election of 1864, when Abraham Lincoln's reelection over George McClellan cemented the Republican Party's status as the major alternative to the Democrats. Since then, the Republican and Democratic presidential candidates have dependably received no fewer than 37% of the popular vote, with the two exceptions occurring in contests wherein a major third-party siphoned off a sizable fraction of one of the party's bases; in 1912, Theodore Roosevelt did this to Republican William Howard Taft, and in 1924, Robert La Follette did that to Democrat John W. Davis.
*** - We have never had a situation in which an extraordinarily popular - and thus compellingly electable - candidate has been pitted against an incumbent president whose performance is such that he could normally depend upon winning as a result of it. As such, there is no reliable way of knowing what would happen in that situation (although my suspicion is that the incumbent would triumph).
**** - The only possible situation in which an exceptionally popular candidate (like Washington, Grant, and Eisenhower) could conceivably lose is if the opponent is an exceptionally popular incumbent. In that scenario, it is conceivable that even the unusually adored candidate will still wind up losing due to rule (a); so far, whether that would happen has yet to be seen, since both parties have wisely avoided potentially wasting such sure tickets to power.