The shape of American politics continues to change over time. George Washington was a Revolutionary War hero who became president. Dwight Eisenhower, president from 1953 to 1962, was also a war here, but in his case, he shined in World War II. George H.W. Bush served in the U.S. Navy during World War II before he was elected president in 1989.
Serving in the military gave presidential candidates a certain amount of political capital. Patriotism was considered automatic. So were other character traits - honesty, character, and integrity - just to name a few.