Defense Secretary Jim Mattis, one of President Trump’s most important early advisers, is the latest to depart the administration.