That's a pretty wild comparison?
> What if I moved out of the country? This seems bizarre to me as an American. I’d do as little work as possible for that time and be resentful about it.
Well, things are usually a little more relaxed during that period. The employer is also required to make accommodations for you to find a new job, e.g. allow time off to go to interviews. As for leaving the country or not showing up, sure, the company might have grounds to sue and they could certainly stop paying you in that case, but, y'know, generally people act like adults.
There are exceptions to this rule about notices, so a day-to-day firing is possible in extreme circumstances. Like if you're not showing up at all, or blatantly not doing your job, are violent etc., you can be banished from the workplace and not paid from that day. But the point is, if you've been doing your job and get fired, you have the option to be at least somewhat reasonable about it and in return you get three months to find your feet and move on. By far most people take this.
Also, in the converse situation, where it's you who wish to leave, the rule is that you give at least one month's notice. This is sometimes not what you want, of course, but I think most people view it as a fair and reasonable trade, especially in light of the rules about getting fired.
It always possible to get rid of either an employee or a role. The problem comes when you're getting rid of a whole department or say 10% of your employees. There are a lot more rules around that.