In class action lawsuits (Rule 23, Federal Rules of Civil Procedure in the U.S.)
any settlement must be reviewed and approved by the judge, who has a duty to ensure it is "fair, reasonable, and adequate" for all members of the class. Judges often reject settlements if they appear unfair, too favorable to one side (often the defendant), or if attorney fees seem excessive.