For the most part, the causes of hallucinations are the same regardless of content: various forms of psychosis, and psychoactive drugs, many of which have been named by others.
The content is mostly shaped by what happens to already be in the brain ie. culture and life experience. A person living in modern day America might say that government agencies or aliens are hiding cameras in his toilet, while a person living in a traditional animistic culture will say that they see or hear the spirits of the rocks or the woods. The mechanics are the same.
I can't go into the details of psychotic experiences here. To be honest, though we know a lot about them in terms of what brain regions and neurotransmitters are involved, they're not FULLY understood.