Seems to me this implies that companies that do this, have found a way effectively measure performance and productivity. I don't think OP intends to say this, it is pretty much impossible to measure productivity of individual developers. I mean those on the team know who is or isn't contributing from day to day, but among teams and over time it is much more difficult. If someone has figured this out they should be a $billionaire by now.
I'd go further and counter that this is completely bogus claim, and yes, no one hiring should view a candidate being laid off as being related to anything performance or desirability of the candidate.
In my experience, layoffs are merely a popularity contest.