There are many factors. I look for all of the standard stuff like keep the glasses full, bring the bill promptly, and being friendly. One item that I base my tip very heavily on is politeness. I rarely eat at a restaurant (maybe once a month on average), but when I do I'm usually astonished by how many servers seem to have the "I don't care, I hate my job" syndrome. I can sympathize with this, but when it's so overt that a customer notices and is uncomfortable then you need to readjust your attitude. I'll tell you about two recent experiences I had in restaurants - my best and worst and how I reacted

:
I went to IHOP with a few other friends. This was about 3:00AM. They were busy, but it wasn't crazy. We were waited on promptly by a woman who had just come onto her shift and was definitely not wanting to be there. She was extremely rude to all of us and made a poke to my friend about his weight :| Our drinks came more than 10 minutes later. Food came sporadically. We had to ask several times for our food that she seemingly forgot about. The last one of us got food an hour and a half after ordering - it was bacon and eggs. None of us left her a tip. In addition, I spoke with the manager about her. The manager was apologetic and gave me a nice discount on the food.
I am one of those nerds that goes to quiet little restaurants by myself with school work. One of my favorite places is a cozy little Italian restaurant downtown. I'm given my preferred seat (booth + window). I'm waited on very promptly by a very nice, short, and plump Italian woman. She's very knowledgeable about the menu and I take her suggestion on what to eat. The place isn't very busy, so I stay there quite a while with my work - of course I ask to make sure that this is OK. She checks back on me periodically and keeps filling my drinks. I ask her for pen and paper - she gets it with a smile. I ask her if she has any fruit around - she comes back a few minutes later with an apple. Very cool. Overall, she was extremely polite, was always nearby when I needed her, and made me feel welcome to stay longer then I probably should have. On my way out I thanked her and her manager for the great service. My bill came to $15ish which I paid with my credit card. I then left her a $20 as a tip. Now I visit this restaurant several times a semester
eyecandy - Just starting this thread makes me believe that you care about your job and want to do good at it - even if only for the tips

If you honestly want to do well being a waitress then just be yourself - it'll show to the customers and you'll get your good tips.