Nightmares are unpleasant dreams that can cause fear, despair, anxiety or sadness. There is actually a defined difference between nightmares and bad dreams: while the feelings they cause might be the same, when they get intense enough to wake you up that's a nightmare. But what's the deal with the horse?
The mare in nightmare doesn't come from the modern English mare meaning a female horse (night is still the night). In stead it's from the old English word borrowed from Germanic and Slavic languages. Mare or mara was a malicious spirit in those mythologies. One that was said to sit on s sleepers chest applying pressure and making it hard to breath. These forms in turn are derived from the word mer which meant pressing, crushing or even oppressing in those old languages.
Even in Finnish the word for nightmare, painajainen while not deriving from those words or names from other languages has the same base word in there. In Finnish painaa means to press so painajainen would be sort of something that presses.
At least those mares said to sit on people's chest aren't as heavy as those other mares.