Class action lawsuits can be costly and risky for a law firm to pursue. Often they are extremely complex in nature due to the legal issues of the case and also by virtue of the logistics in dealing with the sheer number of claimants involved. Costs for carrying the case, such as legal time and expenses (i.e., disbursements), administration, advertising, research and expert reports, are all borne by the law firm. Individual claimants are normally not charged anything unless the lawyers are successful in recovering compensation for them.
Legal fees for class actions are generally calculated as a percentage of the amount of compensation recovered (typically 20-30%), plus whatever amount the defending side contributes towards legal fees or expenses.