How a veteran with very little experience in foreign intelligence ended up overseeing the nation’s spy agencies.