Apparently this is an unpopular opinion on HN, but a job isn't an output that companies produce, it's an agreement to compensate an employee in exchange for services, and just as the CEO shouldn't take it personally when one leaves to go work elsewhere, nobody needs to act like it's some kind of invidious social contract violation when the company no longer needs some of those services. In other words: resignation and termination are ordinary exercises of each's right to reallocate its resources.
(I am making a normative claim, not a descriptive one; I am aware that that both CEOs and laid-off employees do in fact take it personally at times.)