This is a very interesting essay written by Carlo M. Cipolla in 1976. It's a comedic exaggeration, of course, but it's not grossly exaggerated. For example, every interaction with a stupid person isn't damaging to a person who is not stupid, but on balance and over time such interactions become profoundly damaging.

Also I think people who are not stupid but suffer from mental illnesses are just as harmful as sane but stupid people are. I think people who are not stupid but merely assholes are just as damaging as the stupid are too.

But read this and be informed by it, and you'll find yourself recognizing stupidity when it shows itself, feeling rightfully alarmed by its presence, and refusing to engage with it no matter how hard it tries to engage with you.

You can't help stupid people (or crazy people or assholes), and in the long run and on balance they will only harm you.