It’s the exact same in the US. Most companies pay a decent severance that is tied to tenure and is meant to avoid lawsuits. If you resign and they don’t want you to stay for 2 weeks then they will still pay you.
Severance is different, though. My contract, for example, requires the employer to give me 3 month's notice (well, potentially up to 4 since the 3 month timer doesn't start until the first day of the month after notice was given), and without a very good reason to do so (we think we might run into cash problems if we don't do this wouldn't count), they'd have to offer a significant amount of money to get me to leave voluntarily - often times that ends up being about a month's pay per year worked.