Where did the phrase "you're welcome" come from?
"You're welcome" as a response to "thank you" makes absolutely no sense. You're welcome to what?
The first references to welcome are found in Beowolf.
By 1300, “welcome” was being used more loosely to describe something acceptable, pleasurable, freely permitted, or cordially invited.
From Othello: (circa 1603):
Lodovico: Madam, good night; I humbly thank your ladyship.
Desdemona: Your honour is most welcome.
From the linked source:
A reader found an earlier citation in The House by the Churchyard, an 1863 novel by the Irish writer Sheridan Le Fanu: “ ‘I thank ye again, sir.’ ‘You’re welcome, my honey,’ rejoined Toole, affectionately.”
I don't find it at all mysterious. I imagine it like
You have done well to come to me; I am pleased to do it.
I was taught to say it. In French, they say avec plaisir (with pleasure) or de rien (it's nothing), in Spanish, con gusto (with pleasure) or de nada (it's nothing.) *
(Source)
*In the part of Quebec where my parents were born, "Bienvenu" (you're welcome) was the response to "thank you". I actually never heard "de rien" until I was in France, although I don't know what the answer is in Montreal.
It is actually a sensible response to thank you. All you have to do is look at the modern replacements for it.
When someone thanks me, I'm often wont to say "No problem!" as my response. Or, "It was my pleasure." and so on.
The welcome in you're welcome is a statement saying: *I would do this for you again, if asked." (i.e. You're welcome to ask me again.) See Susan's excellent answer for the origins and evolving usages of the word welcome.
Now, this may or not be a true statement. If someone thanks you for donating a kidney, and you hazily say "You're welcome!" I do not believe that anyone would think you would happily donate the other kidney.
But, on the other hand. A think a thank you for a larger favor rarely elicits a simple you're welcome in response. Rather, after donating a kidney, one would probably gush on about how this person is an important part of their life and they couldn't bear to stand by whilst they were dying, and so-on.
In short: You're welcome to accept this as the correct answer. And, if you do, I will thank you.