Why Do We Tip?
The problem with that explanation, as a number of people argued, is that it depends on customers substantially varying the amount of their tip—and many, perhaps most, don't. If you almost always tip 15% and occasionally raise it to 20% for good service or lower to 10% for poor, that isn't much of an incentive to the waiter.
It occurred to me that there was another possible explanation, having to do with the customer rather than the waiter. People like to feel generous. Giving a tip when you know you don't have to makes you feel better than paying the same amount on the bill. People like to feel honest and honorable. Abiding by the implied contract to tip if you get reasonable service, when you know you could have stiffed the waiter and saved the money (provided you don't plan to come back to that restaurant), gives you a chance to prove to yourself and your table companions that you are an honest and honorable sort.