The determination if a company violates that (as in, they're getting rid of YOU not the position) becomes a whole set of legal arguments.
redundancy = getting rid of the position and it can't come back under another name.
firing = getting rid of you as a person.
Why? Because if you get laid off, you can collect unemployment, but if you get fired for cause, you can't. But if you think the company pretended they had cause when they didn't, you can appeal, and the company will have to spend considerable resources defending their position that they had cause. As such, many employers legally classify all firings as layoffs because it's often not worth the hassle. And there's no penalties to doing so, either.
So if you get fired but the company officially considers it a layoff, it's a good thing for you: you dodged a bullet.
Of course, as these things go, it became an verb in management speak. "Yeah, remember so-and-so? He was ok but didn't really get it so we RIFfed him last year".