You’re wrong. Both Obama and Trump fired Mattis. Trump rehired him because he thought Mattis had been wrongly fired by Obama and Mattis was very knowledgeable about the military, hence was an asset. But then Trump fired Mattis for a different reason than Obama.
MILITARY TIMES
“Trump insists he fired Mattis, says former defense secretary was not too good’ at the job”
Doubling down, eh Hostage?
You need to learn how to do research.
Mattis sent his letter of resignation to Trump on December 20, 2018. Trump’s comment that day as reported by the Military Times was :
“President Trump on Thursday announced that Defense Secretary Jim Mattis would be retiring at the end of February.”
Three days later on December 23 as reported by Military Times, Trump announced that he would replace Mattis sooner, starting January 1, 2019:
“Just days after Defense Secretary Jim Mattis announced he would step down from that post in late February, President Donald Trump announced he would push the popular Cabinet member out even earlier.”
So the only “firing” that happened was Trump’s decision to hasten the effective date of the resignation that Mattis himself had tendered.
To anyone paying attention it is a case of “You can’t quit, because I’m firing you”, done three days after the fact. Obviously it fooled you.