It's a very valid question - and one I've pondered for years.

Ever since I was a boy, I've always been fascinated by ghost stories. When I was a teenager, our family moved to Devon and I eagerly devoured the self-published books on 'Ghosts in Devon' and 'Haunted Dartmoor.' For such a desolate place, it sure seemed thick with hauntings.
For a few months, I even lived in a haunted pub - one visited by the ghost of former highwayman Tom King, who was said to ride his spectral mare through the hallway of the inn (and on dark nights, you could hear the clattering of his horse's hooves on the cobblestones.)Did I ever see Tom King? No... In fact, the only thing that ever occurred to me while I was living in the Stag Inn was returning to my room to find all the lights and electric switches turned off. If Tom King was haunting the place, he was being very environmentally aware about it!
But plenty of people HAD heard Tom King clatter through the hallway, so I've always had an irrational belief in ghosts (tempered with a rational understanding of why they might exist.)
According to popular myth, ghosts are spirits of the dead. There are two classes of ghost. Hauntings, which are passive and Apparitions, who are active. I'll get to Apparitions some other time.

Haunted Houses
Most hauntings are well recorded and have been seen by more than one person. They are normally limited to a fixed geographical location - a particular room in a haunted house, or a particular location outside.
Hauntings appear to be like a wretched replay of some horrific event. Most people report that haunted locations involve a specific ghost doing a specific thing at a specific time. A popular one in Exeter was a Roman centurion, clad in armour, walking through the pantry of a pub. He always arrived at the same time, walked the same path and disappeared through the same wall. His appearance had been corroborated by many independent witnesses - yet the ghost never interacted (or even acknowledged) any of them.
So what are hauntings?
Most ghost stories and hauntings revolve around a specific even in history - a murder being the most common. So-and-so was murdered in this spot 250 years ago and ever since, their ghost has been seen haunting that spot.
Many people argue that the 'ghost' is their spirit, cursed to walk the Earth after death. Entirely rational people, however, believe it's something else entirely.
Allow me to digress...
I have a friend who can walk into your front room, sniff the air and say: "Ah, you had fish and rice for dinner last night."
It's not that we live in a fish-scented house - their nose is just so sensitive, they can identify smells that other people wouldn't even notice.
Things like smells linger for days after they've gone, even though they're undetectable to most of us. Likewise, scientists have successfully identified and separated sound waves bouncing back and forth in a room hours or even days after the sound in question was silenced. Similarly, some people theorise that emotions can remain lingering in a location, if they're strong enough.
It's a theory that holds water. Just think of the last time you went to an old church... Stepping through the door, even if you're totally alone, it's impossible not to suddenly feel awash with a sensation of calm, tranquility and introspection. People have been feeling like that for centuries in that location, so even the most emotionally insensitive of us (i.e. me) will admit that places like churches can instantly and inexplicably affect one's mood because of the mood of hundreds of people who've been there before me.
By that theory, it's quite possible that a brutal murder would leave a similarly vivid emotional 'vibe' behind. Strong emotions of anger, fear, pain, suffering, guilt and remorse flood the room when the event takes place and linger for centuries afterwards.
A common theory about ghosts is that the people who see them tend to have an acute sense of emotion, which means they can pick up on lingering emotions that other people are oblivious to...
But because there's no real 'sense' of emotion (it's a kind of sixth sense) their brain misfires into them experiencing visual or aural manifestations of this traumatic event.
I don't know if that theory sounds remotely plausible or not, but I know this much. I've been to certain places where horrible things are said to have happened (like the aisle in Chagford Church, where a bride was gunned down by a jealous lover, in an act that would later inspire the novel Lorna Doone.)
I felt cold and uneasy, nervous and uncomfortable - and I'm not even 'psychically attuned.'
I can certainly believe that somebody more sensitive might experience the same feelings I did, just much more acutely.
It's only a theory, of course, but it's a fairly solid one. Most people I know share the ability to detect a 'vibe' from a room or building. Some homes, for example, you walk into and feel bright and happy (like the love of the family who lived there is still keeping it warm and cosy.)
Other places just feel wrong. I remember exploring old Nazi bunkers in Normandy with my friend and feeling something more than just an understandable sense of claustrophobia chilled me to the core.

I don't know - as I wrote earlier, I've never seen a ghost. Yet if a friend of mine can sniff the air and tell me what I cooked for dinner the night before, it doesn't seem any more impossible that a similarly 'talented' individual could detect the psychic echoes of some traumatic event in a location's distant past.