First of all, we are talking about ethical responsibility here, not contractual or legal responsibilities. Generally, one’s responsibilities are related to the possible harm caused or contributed to by one’s actions that one is in control of. Concerning employees quitting their job, for example the tech lead of a small startup whose survival critically depends on their knowledge can be considered to have a bigger responsibility to not quit on short notice and without compelling reasons out of their control than, for example, a dispensable and easily replaceable entry-level dev in a big tech company.
Companies however also have some responsibility to not make themselves too dependent on individual employees, to the extent practical. The responsibility for the harm caused to the company by an employee quitting is therefore shared. This is in contrast to a layoff, where the employee usually shares very little responsibility for the harm caused to them by the layoff, because it’s largely out of their control.