As defense secretary, Mr. Mattis oversaw the world’s most powerful military, supervising active-duty troops based in the United States and deployed worldwide, including in war zones in Afghanistan, Iraq, Syria and on the Saudi border with Yemen.