The American Journal of Philology has an article entitled On the Origin of “Had Rather Go” and Analogous or Apparently Analogous Locutions. It says:
Of the verb have, Dr. Johnson, in his Dictionary, gives, as the
seventeenth definition, “to wish, to desire, in a lax sense,” and
adds, by way of exemplification, the familiar Biblical passage:
- I had rather be a doorkeeper (Ps. 84:10).
[That's KJV, so think 16th century. Which makes me think of Shakespeare. He used it quite often:
e.g.
I had rather hear my dog bark at a crow, than a man swear he loves me. (Much Ado About Nothing)]
The article from The American Journal of Philology continues:
A still more disparaging opinion, perhaps a maturer, he [Dr. Johnson] records
under the adverb rather, where, as introductory to a sentence containing the phrase
- He had rather mankind should adore him,
after premising “to have rather,” defined by “to desire in preference,” he remarks:
This is, I think, a barbarous expression, of
late intrusion into our language, for which it is better to say will rather.
It's a very interesting read, I think you will find all your answers there. The article quotes grammarians who agree that had rather is strangely ungrammatical:
Had is an auxiliary verb, and so cannot be coupled with an infinitive.
Thus argued Thomas Sheridan, in 1784:
‘I had rather’. This
phrase is strangely ungrammatical. Rather means ‘ more willingly.’
The adverb rather is expressive of an act of the will,
and, therefore, should be joined to the verb to will, and not to the
auxiliary to have. Instead of ‘I had rather’ it should be ‘I would rather’.
Bishop Lowth remarks, in his Short Introduction to English
Grammar:
It has been very rightly observed, that the verb
had, in the common phrase ‘I had rather’ is not properly used
either as an active or as an auxiliary verb; that, being in the past
time, it cannot, in this case, be properly expressive of time present ;
and that it is by no means reducible to any grammatical construction. In truth, it seems to have arisen from a mere mistake, in
resolving the familiar and ambiguous abbreviation ‘I'd rather’ into
‘I had rather’ instead of ‘I would rather’ which latter is the
regular, analogous [read analogical], and proper expression.
I don't want this post to become too long but I will still add what the article says about Merriam-Webster's opinion about the matter
Later grammarians and lexicographers, in general, accept this
solution; and the editors of Webster’s Dictionary go so far as
confidently to pronounce had rather, had as lief, and had better to have been ‘originally, mere blundering interpretations of the abbreviated form of would as in I’d rather’.
Despite all that, the expression had rather is considered idiomatic, though listed as archaic/literary in dictionaries. This question about the usage of had rather may also help.