Layoffs are “supposed to be” non-performance based. “Our widget didn’t sell so we’re laying off the widget makers”. That’s the generally accepted idea.
In the US you totally can sue if they fire you for a protected reason (“we noticed you were missing meetings on maternity leave, men would never do that”). Some people would sue over anything I’m sure.
If you’re a salesperson and you didn’t sell anything for 5 months, that’s performance based and it’s “reasonable” to fire them. They’d probably not sue. You can tell someone they were a poor performer without legal repercussions, assuming you’re not being shady. Typically HR and legal put together some sort of evidence just in case.
It’s just mean, but maybe fair, to lay off the entire sales team and call each person and tell them they were a bad performer. Bad look to do it after the Cloudflare CEO went around a press tour last year bragging about how they won’t do layoffs and now’s the time to invest in talent.