Are you US-based? Because severence packages are absolutely an exception, rather than the norm. Most of the US has "at-will" employment, which states that employers can terminate employees at will, for any reason, without warning. And companies take advantage of this all the time.
The other thing is that you seem to be speaking as a developer. Everyone knows that our industry treats employees better than average. You really need to look at the broader landscape though.
"Most of the US has "at-will" employment, which states that employers can terminate employees at will, for any reason, without warning"
I think this is a misleading (although frequently stated) comment.
Large companies I've worked for have a bureaucratic procedure before they fire anyone, and generally allow people to save face even when they really want you gone.
Technically it's "at will", but I think it's primarily the mom & pop businesses that are going to fire on a whim.
Furthermore, you are implying that there are no constraints on companies in the US, like for instance the WARN act.
"primarily the mom & pop businesses that are going to fire on a whim"
Talk to some people in the hospital business who are over 50. I have a friend who worked for a huge hospital, was good at her job, had been doing it for many decades. One day an HR person called her into the office, said she needed to take a test, and said she had to leave that day until she took the test, administered by some 3rd party. A younger worker, doing the same job, also didn't have this credential they invented, but she got to stay. She wasn't making as much money because she hadn't been there as long.
My friend had a couple of weeks to study for this test, which was about the physics of the machine she had been using for 30 years. She failed the 1st time, they wouldn't tell her her score, and wouldn't tell her what she got right or wrong. The test itself was ridiculous: how many of us could explain in detail the physics of how our hard drive works? She was given a small severance and told to sign papers that I'm guessing gave up her rights to sue. And besides, it's well known in my area that suing a hospital is a fool's errand. The local lawyers do so much business with hospitals that they won't even take cases against them.
If you tell someone "your job ends today, but we'll give you a month's pay if you sign these papers", many people have no choice but to sign: they can't afford to have zero income starting today.
A quick search suggests that "many" firms pay severance, but I couldn't find hard numbers. In my experience it's not that unusual for people to give no notice or less than 2 weeks notice when they leave blue collar jobs like restaurant work.
Sure, but that goes back to the point that supply and demand are driving these sort of concessions by employers. Devs are in high demand and low supply, so the concessions are much higher than say, a retail job. I would say severance is common in "professional" roles, whether that be an accountant or middle manager. It's certainly less common in blue collar work and lower skill work. Despite the existence of at-will employment in some states, many companies in these states still choose not to fire indiscriminately. I think that it's smart business practice to offer severance, because companies are reviewed these days on sites like Glassdoor. A company with a bad reputation for treating employees is going to have a hard time attracting talent.
The other thing is that you seem to be speaking as a developer. Everyone knows that our industry treats employees better than average. You really need to look at the broader landscape though.