How does a place get haunted? What is haunting?
First of all, ghosts are real, but they aren't real in the sense held in the popular imagination.
Let's take a house that is, say, one hundred years old. Families, relatives, friends, etc., occupy the house over time. Something happens that creates a tear in the energy; most often, someone croaks it in a bad way.
Usually, the worst that I have encountered have been fueled by hate, since I can't think of a better word.
Violent death, extreme grief, sometimes even closer than usual ties to a place or series of events will create it. Then you get ghosties. Most people will lay off the entity to being the person's spirit who has remained trapped there. What really gets left behind is energy, but not the totality of the person. Often, like a ball of wax rolling across a carpet, it picks up threads and pieces of other energies over time. Before you know it, you have a full scale haunting. But to lay this new entity off on the life of one person isn't really accurate. It is an amalgamation of energies, which is what makes dealing with some of the more extreme ones very difficult. In this case, like attracts like, sort of the way sediment will gather at the bottom of a glass of muddy water if you let it sit long enough. Full-blown activity by one of these things is pretty rare, and most of the time, you are seeing a neophytic form when confronted with the situation.
You have to find the keys to its dissolution.
What animates it? Is it haphazard intent linked to some animating source?
That's interesting, glad you brought it up. Different things can animate them. Usually, the worst that I have encountered have been fueled by hate, since I can't think of a better word. Sometimes small entities which are floating around all over the place, but which are harmless, get involved and give animated direction to the entity. So, a poltergeist gets involved, and suddenly you have a dreadful "thing" on your hands. I reserve the word "ghost" for purely human energy. Sometimes there is enough gathering of energy from different layers of time and events to create a real problem for anyone coming into contact with it. It can be as simple as dealing with only one aspect of the ghost, as in one person. I guess you can think of them as multiple personality entities. Usually this type of energy is not a problem; in fact, sometimes it can be entertaining.
How would you deal with one of these entities if it were a problem?
You have to unravel it. You have to find the keys to its dissolution. Do research, both energetic and in the deed books or library. Once you know where it lives in terms of it's makeup, you can rearrange and change the energy of the house to basically dissolve it. It won't become apparent, usually, until it latches on to some other type of energy. In that case, remove the energy it has latched on to. Confrontation will sometimes work, too; you're basically saying you're not getting any energy from me. Most of these things get stronger feeding off the energy of discord - not all of them, but most. There will be something usually that is the first thing it latched onto. It could even be energy in objects that were brought into the home. Let's say you have an old whatever, and it was present in a room in a house where someone died violently; there is enough there to latch onto to start with. Metal and glass seem to be worse than wood or cloth, but it really is a small difference.
Anyway, that covers one aspect of entity energy. There are tons more of course. Well, maybe not tons, but a lot. There are critters that live with us. Human energy bent to a certain task over a long period of time, the energy of different living creatures and plants, dream entities, lots o' stuff.