Why do we call it a nightmare?

So, what do female horses have to do with bad dreams?
I fail to see any connection… - Jinx

http://www.uselessknowledge.com/word/nightmare.shtml

The OED tells us that a mare, in addition to meaning a female horse, also means:

The word “nightmare” dates back to at least the 13th century.