John Sides parses new research:
Perhaps the most consistent predictor of presidential greatness, Messrs. Uscinski and Simon found, is military service. Serving on active duty during both wartime and peacetime, as well as the number of years of service, is associated with higher scores in many domains, including crisis leadership, international relations, and economic management.
Service in the federal government, either the executive or legislature branch, has few apparent effects. It typically matters only in narrower domains.