He made his reputation as a battle-field general, and he will always have that.
When he undercut Trump at the border, I thought then, he would have to go. Trump was trying to run a bluff there, to convince the caravan to turn around. He needed a big show of force. Instead, Mattis was telling everyone he was not going to use troops to patrol or anything else. Even if that were the reality, to say so out loud only encouraged the caravans.
So he needed to be fired, from that moment on. Trump only waited a few weeks to give him his dignity. When he took a shot at Trump in his resignation letter, though, he forfeited that consideration.
Mattis reportedly said some time back about combat that he enjoyed shooting people and enjoyed fighting.
I have talked with family members that were in combat and that I respect. Never heard a real combat veteran say to me that he enjoyed fighting or shooting people.
For one thing, sustained combat usually means buddies will be injured or killed even if you are not.
I'm not sure what to make of the Mattis boast.
Incidentally, he was apparently conned big time in the Theranos scandal. IIRC, he lavishly praised the ethics and maturity of Elizabeth Holmes. (in the book "Bad Blood")