It's interesting also to think: why would you even have the need to "figure this out". I mean, it just is. Using high-level analysis, like Freud, leads to lots of atrocious fallacies, certainly. The only real understanding is physically to observe the processes in the brain, by neurons, synapses etc. and see exactly how this happens.
In ancient times they respected such people (again baseless, or more precisely, religion-based). In recent times there is some underlying accusation by society, or it's regarded as a personal problem that has to be "fixed". I don't see how both attitudes help to better understand what's really going on. If the brain imagines evil forces, it is because of things this brain has been presented by reality. If there were no concepts of evil forces around, this idea wouldn't exist inside.
Psychiatrists have a higher rate of mental illnesses, and if all of us become experts in psychiatry, which seems to happen lately, well, the average mental health will decrease, of course. Another option would be to think about more applicable things.