When executives get fired, they are told to resign by the board so it doesn't officially become a firing.
Randomly, Musk was fired as CEO by the board of PayPal after four months, and on the Monday morning of him leaving on his honeymoon following getting married that weekend. Which says something - not "told to resign", not "focus on family and new life", but "okay, he's getting on a plane, don't bother coming back".
Even at the lowest levels of a company that is common. If you fire someone you need to do a lot of paperwork just right or you can be sued for incorrect firing. Even if the company would win (which is likely), the court costs are high enough that a company would rather not. By contrast if you quit it was on your terms and so you can't sue. The only thing a company loses is if someone is checking references they can't say they fired you, they have to say you left in good standing (which is why you should accept this offer - your next job may check references)
Note the fire is very different from layoff legally. Fire means they need your job done, but you weren't doing it. Layoff means you were fine they just don't need your job. Layoff often comes with severance pay.