Y'all, what causes a haunting isn't fully known, but it very obviously (to anyone that pays attention to these things) involves a combination of factors.
Typically, more than one factor needs to be involved:
Someone dies violently.
Someone dies that lived a shitty love and is afraid of final judgment.
Someone died with unfinished, urgent or important business.
A location where someone did a lot of work that they used to identify themselves.
Replay hauntings seem to be placed where someone experienced a prolonged stressful situation in that location. That be be someone haunting a place that died elsewhere.
Places where both mental health issues and stress were left to simmer for years.
Someone fucked around with a oiuja/spirit board a lot in a place.
Water or stone, especially both, plus a prolonged stress factor.
Some hauntings seen to only manifest when certain people are in the space. Especially poltergeists.
There's no one way to get a haunting. Much of it depends on severe emotional states. Otherwise it would be a repeatable process. But, like it or not, it does seem to be something that humanity has experienced since we learned how to error down what was going on.