Earlier quoted context omitted.
The article states the answers to your questions.
I hate butterfly keyboard and I think it's one of the worst mistakes Apple ever made, but I'm afraid I didn't find anything in the article that mentions what "consumer protection law" that Apple violated. As far as I know, Apple followed through with their warranty. There's no safety issues with keyboard failures. Where/when does the company's liability end with their product ?
> Apple is accused of, among other things, violating California's Unfair Competition Law and Consumer Legal Remedies Act, the Magnuson-Moss Warranty Act, the Song-Beverly Consumer Warranty Act, and breach of express warranty.
I certainly don't know enough about the law to comment on whether they're actually in violation of anything there. But as a complete layperson the argument "Apple knowingly sold keyboards that broke unreasonably quickly, and took a weirdly long time to change that" is persuasive under some vague sense that products should be suitable for reasonable use.