This can be treated with entrepreneurship and human action. It's not pretty intuitive, but if I am really annoyed of a place being polluted or a road being in bad conditions, I can hire people that can do the work of cleaning and repairing. Some of them are better at doing those works than others, so they charge me less money. In doing these works, they're slowly but surely contributing technologies and ideas to determine what appeases that "unease in my mind". Maybe they don't know, but they're competing exponentially and even beyond to just satisfy my needs, the needs of the person that has the money.
TLDR the free market is like hiring Hulk to do the job.
The argument above also applies to my personal defense and security
An interesting article about all of what I said is this (interesting but a little off topic. Maybe you will find it familiar because it talks frequently about sports):