The big difference between those two cases is when it's the company's decision, they have plenty of opportunity to plan for the transition and may frequently conclude that they've done enough for the transition before the conversation with the employee.
That doesn't follow at all. The notice period exists so you can transfer your knowledge and projects to colleagues who will take over your work.
If the notice period is in the company interest when people leave on their own, it's also in the company's interest when they have to leave?