Specifically Eisenhower and Grant. They both followed large wars with military backgrounds. Just by a glance at wikipedia their predecessors were a democrat and a democrat on the national union ticket.
Were there other specific elements that brought this on? Fear, their opponents, other hot issues at the time?
Can't comment on Grant. But for Eisenhower, there were numerous issues which boosted his appeal. I believe most historians would agree that Eisenhower likely would have been elected President regardless of whether he ran as a Republican or a Democrat: he was almost unimaginably popular with Americans.
By 1952 the Dems had been in power for nearly 20 years, and beyond the obvious understandable drive for change, Americans were also suspicious of a number of corruption scandals Dems were involved in. Truman was also in charge when the U.S. "lost" China, and he'd "failed" to prevent or end the Korean War. This was also the age of McCarthyism and Nixonism (I use this term because while Nixon clearly engaged in red baiting he also actually succeeded in showing with the Hiss case that there were communists in high positions), and the Democratic party was viewed as somewhat incapable of doing anything about such infiltration and subversion.
There was something of a feeling that America was "losing" the Cold War in the early 1950s, Eisenhower, the man who led the Allies to defeat the Nazis, offered to lead a crusade to make America great again, stating "I will lead this crusade." (This wasn't a one-off, he used "crusade" at least 5 times in that speech).
EDIT: By "that speech" I mean his acceptance speech when he secured the Republican nomination.
William Leuchtenburg recently published a nice volume on presidents from T.R. to Clinton, The American President which provides great context for each president and the transition to their successor.