"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.) *
*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.
From this etymonline entry, about welcome:
Old English wilcuma "welcome!" exclamation of kindly greeting, from earlier wilcuma (n.) "welcome guest," literally "one whose coming suits another's will or wish,"
So in both, when you say welcome (home) or you are welcome (to my help) there is an implication of pleasure. I think that's the key: think of both as related to pleasure.
It fits the translation of welcome as bienvenido and you are welcome as con gusto as said in one previous answer, because they are related to pleasure.
In spanish language you are welcome is also translated as It was nothing, but seems not to be the proper translation. Another explanation can be that You are welcome has changed its meaning from It was a pleasure to It was nothing.
Merriam-Webster online gives two relevant definitions for the adjective:
- giving pleasure : received with gladness or delight especially in response to a need ("a welcome relief")
and, probably more relevant
- willingly permitted or admitted ("he was welcome to come and go" — W. M. Thackeray)
The implication of "you're welcome" in response to "thank you" is that the action for which the thanking party is grateful was willingly and happily given -- it was a pleasure on the part person being thanked.