Question from a curious person: if goverment lost the ability to regulate factories how does society protect the local environment?

If a factory puts out cancer causing chemicals into the water and people are suffering because of it how do you deal with it without invoking a goverment in some capacity. If the goods are destined for foreign markets and the employees are paid well enough to not care about what happens to the locals […]