“All evils are caused by insufficient knowledge” is what David Deutsch has called "The Principle of Optimism". A reason this is a principle of optimism is that it means whatever is going wrong - whatever the evil thing is - whatever we no longer want (or do want but don’t have) is just due to some lack of knowledge (in other words: ignorance) on our part. If we try to create knowledge, seek solutions and search for answers, then with effort - sometimes great effort - we can find them.
Logically this is simply equivalent to “problems are soluble”.
There is some confusion, I believe following deeply entrenched traditional religious memes - about how “evil” should imply intent. This too is a moral claim, of course, about how words should be used. I guess the idea evil must entail intent comes from the idea that there was once considered to be “anger of the gods” or other beings (so natural disasters have traditionally been interpreted in the pre scientific era as evidence of god’(s)’ anger. When we learned lightning was just static electricity sparking, we regarded there as being “no intent”. So god's anger (or perhaps the anger of demons or whatever) was not there, so how can lightning be an evil?). Even avowed atheists inherit this way of speaking and thinking to some extent. Evil can only be evil if there is intent. "...the line dividing good and evil cuts through the heart of every human being" wrote Solzhenitsyn. This can be interpreted in a number of ways. Here's two of them. (1): there are mystical type forces (Satan versus Yaweh, say) or even just "psychological forces" pulling the soul (or mind) in one direction or the other. (2) People possess genuine knowledge (the good) and far more ignorance (sometimes bad) and the latter can cause real suffering. People can also sometimes know what just isn't so: and that's a form of ignorance which can also cause suffering of an even worse kind. The first "force" type way of thinking can be a useful way of framing things but it can also mislead one into thinking that all evil actions must be motivated by evil intent. But they need not be, even if evil philosophies - dogmas of all kinds - can act very much like psychological forces. But there too a person is a victim as much an as active agent. Their intents are shaped very much by ideas they learned on mother's knee and for which they only have partial responsibility because they are only dimly consciously aware of them. Many ideas are unconscious or inexplicit: and if one doesn't know one even has an idea which is directing one's behavior to what extent is one responsible for that idea?
It is often just rank ignorance that causes a person to commit an evil act. People can intend great good - have the best of intentions - and yet they are so profoundly ignorant and mistaken they cause the worst kinds of suffering. It's been well documented certain kinds of suicide bombers apparently feel nothing but (apparently) positive emotions: joy, ecstasy and elation. Even if these emotions aren't actually positive in any ultimate sense, the INTENTIONS of these people are good* - they’ll send their “victims” to heaven - eternal paradise where they can eventually be reunited with everyone they love. So do such people have evil intents? Clearly not. They are motivated, on some accounts, by deep love as perverse as this may seem. (See here for that: https://samharris.org/islam-and-the-misuses-of-ecstasy/) But it’s evil nonetheless. Their intentions don't matter to the evil of the matter at hand.
Intention does of course make an important difference in a legal sense (though I disagree with some of what the legal system has to say about this: for example that "mental illness" is a defense because the intentions were different - but this is beside the point for now). But there is a clear difference between accidentally knocking someone into traffic and deliberately pushing them. There, intent is everything. In either case a civilized legal system shows compassion, but in the former it might very well result in no gaol time at all, while in the latter one should probably be locked up until a very good explanation is known about whether one is predicted to do that sort of thing again.
I recall quite vividly having a thought myself around age 8, when in Catholic Church, hearing about all the ways we might end up in hell and how salvation came through baptism. I reasoned myself into what I thought was the best possible thing that could be done for the newly baptized: swift death. Indeed what would God think, I wondered, if someone took on an "Angel of Death" kind of position and went around quickly murdering anyone newly baptized so that they went straight to heaven? And what if that person's thoughts were "even if I get sent to hell, I feel it worth it because I have saved so many souls" - wouldn't God look favorably on such a serial killer? Wasn't that be almost like Jesus or even better: the sacrifice of oneself for so many others? Why don't well meaning people just murder babies right after baptism? Why don't loving parents? Are they selfish? After all - babies are necessarily innocent and would go straight to heaven once the original sin had been removed. I couldn't find a logical loophole. I still cannot...except that I've relinquished much of that religious mindset. But the point is: the intention can be of the greatest good, though terrible suffering (evil!) follows. And why? Because it's the ignorance that makes the difference here: a serious lack of knowledge about reality. There is no supernatural heaven and no God to reward such an Angel of Death.
But if one remains unconsciously in a religious mindset, one thinks “evil” necessarily has to be about intention. One might say a person has evil intent and only people can be evil and so on. In reality, let’s just observe that the typical “evil genocidal dictator” seems to think they too are doing good purifying the world. They have, in their mind, “good intentions”. Of course we see their behavior as abominable. I think it more parsimonious to just say: problems can be an evil. A hazard. A real threat to life, liberty and the pursuit or actualization of happiness.
But if you insist “Only people can be evil” very well. *Shrug*. The terminology doesn't matter to the Principle of Optimism which runs deeper than whether we use the word "evil" or something else. Lightning that strikes an innocent child is, we must admit, a bad thing. What’s a bad thing? A problem - in particular a problem that causes some kind of suffering rather than one which elicits joy.
A bad thing? An evil thing. It doesn’t really matter what words you use. I like David’s formulation of “evils are due to insufficient knowledge” - I think it’s quite right and it follows in a lineage of usage of the word that tries to capture something of its fundamental relevance to morality and of course illustrates, therefore a deep connection between what might have been hitherto thought the separate domains of morality and epistemology. But if some people would rather we just say “bad stuff is caused by insufficient knowledge” or just “problems we’d rather not have are caused by insufficient knowledge” or even "suffering is caused by insufficient knowledge" so be it. It seems that these are just logically equivalent ways of saying the same thing.
“All bad things from murderous intentions to murder, from traffic jams to jamming fingers in doors, from Earthquakes to being hit in the head with rakes, from falling down stairs to attacks by bears and solar flares: these are all bad things and all are caused by our lack of knowledge. If we know how to prevent people having murderous intentions, we should prevent them, if we can find the knowledge needed to predict and stop Earthquakes or mitigate their destruction to zero - we would and should if we could. It all means the same stuff. I’ll continue to call these things “evils”. Of course an earthquake has no intent as such - it’s not motivated, twisting a moustache and concocting plans about how to hurt lots of people. It literally feels nothing (panpsychists aside). But then apparently nor does a psychopath feel anything, or rather anything but joy (though I’m not convinced).
And once more this highlights “other” kinds of approaches to morality and epistemology that call themselves “objective” but in fact fall back into subjectivist “what’s going on in your mind?” and “how does a person feel?” kind of way of thinking. That “objectivism” is at heart subjectivist for that reason.
Actual objective morality and epistemology says: feelings are not the criterion. Private thoughts are not the criterion. What matters is what goes on out there in the real (ontologically objective) world. Are problems being solved or exacerbated? Problems being solved: that’s a good. And being exacerbated: that’s an evil. And why would problems be exacerbated? Because someone somewhere (perhaps everyone) is lacking sufficient knowledge. Recently in Australia many lives and homes were lost in bushfires. One reason is that very well meaning people did not want so-called "back burning" to occur (the preemptive burning of forest and undergrowth around people's homes). Well meaning people didn't want the environment hurt, others didn't want people hurt from the smoke coming from the back burning. No one intended and no one really foresaw the December-January bushfires around Australia. Those bushfires were exacerbated by insufficient knowledge. And the death and destruction was a real evil. Yet no one intended evil (modulo arsonists - but again many of those were children ignorant about the possibilities and others even more ignorant than that). Evil isn't a parochial property of individual minds (though it can be that) - it's just a problem that causes suffering. And natural disasters on this view are an evil to be solved.
Or if you want they're just "bad things". I don't mind. :)
*When I say above "the INTENTIONS of these people are good" I am merely conceding the way the words "intention" and "good" are often used. Namely: if one feels one is intending to do good...then one really is intending to do good. But there is a philosophical subtlety here: one can intend to do good and yet still have bad intentions. This is the difference between a "subjectivist morality" and an "objectivist morality". On the former thesis (subjectivist) things are good to the extent people think they are. It might be yourself in your own life or some kind of consensus (a greatest good argument). On any subjectivist view: it's about feelings and/or personal psychological states including states sometimes referred to as beliefs. So if you really truly believe (or feel) that you're trying to do good...then you are in some way. But on the objectivist view, this is all mistaken. It doesn't matter how you feel: it matters what happens in the world by the measure of: are problems being solved or not? Now on that view your intention does not matter a jot. Your intention can be utterly mistaken. Moreover because morality isn't about personal psychological states we also do not condemn a person for that personal psychological state that was mistaken. We simply correct them. Error is the natural, near ubiquitous state of things and all of us are "equal in our infinite ignorance" as Popper said. So a person who intends to do good (our proverbial suicide bomber thinking they are sending those murdered souls to heaven) has an objectively evil intent. Their own feelings on the matter don't matter. Murdering innocents destroys many means of error correction (namely people) and that halts progress in some ways and slows it in many ways and creates all kinds of terrible problems while solving none. That is an objective state of affairs having nothing whatsoever to do with feelings and beliefs and other private psychological states. We can talk about suffering as a problem - even a painful one and the solution of it without ever worrying about receptors in the brain or, in abstract moral terms, being concerned about how it feels or why it's unpleasant. We just recognize: it's a problem that needs solving. And compassion for others and fast progress in this domain depends on us not getting hung up about who feels what exactly and why. The application of criticism to creative solutions about the problems that harm us most depends on us soberly, rationally applying reason. Everything else is either going to slow us down or cause us to lose focus on finding the solution.