I have a theory, but it's a little far-fetched.
I think the hearts represent Link's passion, his will to fight. In other words, when he gets "hit" by monsters, he isn't actually hit until his last heart is gone. He just escapes narrowly but feels discouraged by how narrowly he got out of it. The increasing number of hearts has to do with the number of people who believe in Link, because he thinks of them every time he gets discouraged.
The reason he starts off with three hearts is fairly simple. One represents himself, and the other two represent his parents or similar paternal/maternal figures. When he defeats a boss, that represents a major accomplishment that he knows people will respect, so he gets a free heart for that. In other words, he thinks "Well, I've beaten boss X, surely I'm not going to fail now!" That's also why he gets Pieces of Heart for helping people out... it sort of implies that he becomes concerned with their fate, and they with his, so he kind of thinks, "Well, that person I helped believes in me now... I can't let them down." Maybe with the hidden ones he finds, it's just "I managed to find that well-hidden secret back there, and no one else had noticed it before... maybe I can do this, too."
Basically, the increasing number of hearts indicate the increasing number of reasons Link can tell himself to go on when he has a close call, thus increasing passion or will.