Ad algorithms "learn" what we want by our behavior, e.g., by maximizing click-through-rates (CTR's). For example, women are more likely to be shown ads for shampoo and conditioner, while men see ads for products that combine the two :
...Irish Spring offers men one green bottle with the instructions: “Pour it on your head and let gravity do the work.”
Which brings us to the US Justice Department, which charged Meta with "discriminating against Facebook users based on their race, gender, religion and other characteristics."
To settle the charge, Facebook said it "would work with HUD" to alter its algorithms to achieve less discriminatory outcomes, i.e., to show us ads that we don't want to see, e.g., for example in areas where we may not want to live.