When you hand something to someone, you say "Here you are." I know this it a set phrase but it looks incomplete and doesn't make much sense to me. How can you paraphraze or complete the sentence?
"Here [is the item/concept that] you are [seeking/requesting]."
While the completion that user yapishkahilt has offered is both simple and elegant, I don't believe that "Here you are" is meant to be understood as an incomplete clause.
"Here you are" is more idiomatic than anything else, as it would literally appear to be a statement regarding the listener's physical location. Instead, as you state, it is used when delivering something to someone. Since it functions the way an idiom does, it can't really be recast without becoming overly stuffy or changing in meaning.
That being said, there are many ways to express the same idea without sounding stuffy:
Here you go.
Here's that [object] you wanted.
And so on. Other possibilities depend on context. For example, if the item was tossed rather than handed to someone, you might say "Catch!" Although this is literally a command for the person to not drop the object, it functions similarly in that you're verbally alerting the person to the fact that you are delivering something to them.
Here it is.
Or, "is this what you needed?"
Most writers of English would not use "Here you are." It's a verbal expression, used only when you have the item in hand.
"There you go." is also used in the same context.
As somewhat of an aside, this can also be used in a pedagogic situation by the teacher when a student indicates understanding of something.
Here is that which is for you.
Here is that which you requested.
I doubt that it actually came from either of these phrases; it might even have developed on its own. For etymology I can be of no use, but I can say that the first phrase will apply to almost any situation in which one may use here you are and the second to many others.