3M has agreed to pay $12.5 billion to resolve lawsuits brought over “forever chemicals” in public drinking supplies.