She didn't "give herself" a raise. That's almost never how executive compensation works (why would any company allow its CEO to pay themselves as much as they want?). The board voted to give her a raise, in accordance with their bylaws[1].
I linked her personal justification below, but to summarize: relative to her professional cohort, Baker is substantially underpaid. Not doing layoffs would have meant offering pay cuts to a significant number of highly qualified engineers, causing attrition. Instead of doing things the slow and painful way, she did them the fast and painful way. If I was in her position and had the knowledge I currently do (i.e., that just about anyone working at Mozilla can find employment elsewhere easily), I would probably have done the same thing.
None of this, however, means that I think CEOs should be paid as much as they are.
I linked her personal justification below, but to summarize: relative to her professional cohort, Baker is substantially underpaid. Not doing layoffs would have meant offering pay cuts to a significant number of highly qualified engineers, causing attrition. Instead of doing things the slow and painful way, she did them the fast and painful way. If I was in her position and had the knowledge I currently do (i.e., that just about anyone working at Mozilla can find employment elsewhere easily), I would probably have done the same thing.
None of this, however, means that I think CEOs should be paid as much as they are.
[1]: https://www.mozilla.org/en-US/foundation/documents/bylaws/