Notwithstanding some of the above replies, almost all class action (CA) suits are litigated under a contingency basis, with plaintiffs getting a larger share of the settlement award than attorneys. That's not because law firms are altruistic, but because they make more money that way.
Most CA settlements return more funds to the plaintiff than the attorneys representing the class, but not by an overwhelming percentage. 40% is fairly standard as attorney share, plus provable expenses. Normally, there are several law firms involved, with one firm acting as lead attorney.
A law firm needs considerable experience in CA suits before the court will appoint them as lead counsel, and have sufficient assets and personnel to organize the investigation, conduct discovery, proceed to trial, etc. Without provable, egregious acts by a potential defendant with sufficient assets, it would be a tough sell to find a CA firm to take on a new matter. The person bringing the claim would need to be dedicated and prepared to spend long hours shopping his/her case. It's not a job for the timid. After a CA firm accepts a case, it will take several years to investigate, conduct discovery, litigate, settle, and pay off claimants.
In extreme cases, such as Levi-Strauss CA settlements, the number of the class victims is so large, i.e., several million potential claimants, that a financial settlement not feasible, so alternative payments are utilized, such as discounts on future purchases. It may cost several million dollars merely to notify the potential class of the pending case, e.g., mailing CA notice of suit to potential purchasers throughout the continental U.S., and then conduct further correspondence with them. Example: Have you ever purchased Levi's jeans during the period 1990 and 2002? Do you have receipts for said purchases? and on and on and on. There will be an office of clerks that will wade through all the correspondence, originate and maintain databases, categorize victims by degree of harm, amount of loss.
It's a system that is easy to criticize, but small amounts of loss by a litigant class with huge numbers is difficult to litigate by other means. When a multi-state communication company, such as Ma Bell in the old days, is found to have illegally charged customers 89 cents/month for a number of years, no single plaintiff will ever bring suit, as it's not cost-effective. A CA suit becomes the only practical alternative.
When a state, such as California, attempts to minimize the % of award a CA firm can charge, or enact any tort reform laws, the trial attorneys spend millions in advertising, alerting taxpayers of the unintended harm such legislation will cause. Not surprisingly, the trial attorneys don't identify themselves as such. They will adopt a catchy phrase for their newly-formed PAC or LLC, such as Californians Against Government Interference or something similar. California voters have always been swayed by the trial attorneys' efforts in these matters to date.