From the Financial Times:
All of this suggests that tipping exists for psychological rather than economic reasons. The display of wealth, status and power, the seeking of social approval, conformity, a (forlorn) hope for future, better service, and guilt over inequitable relationships are all theories put forward to explain why we tip.
Some findings:
[T]he research again finds that regular customers do not vary tips in accordance with service quality. Also, diners themselves admit that how much they tip is not affected by whether they visit an establishment often or never again. …
In one study, waitresses’ tips increased by 17 per cent if they wore flowers in their hair. …
Another of Lynn’s studies involved the server drawing a happy face on the bill. On average this increased a waitress’s tip by 18 per cent, but decreased a waiter’s by 9 per cent.
Link via Marginal Revolution via Kottke.