Really depends on the segment of the industry you’re in. If you work for large companies through glorified body shops, cough cough, I mean contracting companies, then it’s extremely easy for you to lose your job. If you work with open source software stacks for smaller companies or projects, then you can be incredibly difficult to fire.
Reason is, software rewards experience and expertise. The longer you work with a codebase, the better and faster you get with it and so the easier you make it for companies to justify things that would get other developers on other projects fired.