The earliest recorded use of the words "How are you?" appears in Dickens' Pickwick Papers, published in the early 1820s. Before then, people would say, "How do you?" which we still see in the more modern "How do you do?", said on being introduced to someone new.
It is simply a way of politely asking, "In what condition are you" or "Is your health good?" etc.