Depends on the country. In Finland, the price of everything in a restaurant is higher, and thus the "tip" is already included there.
I guess it originates from the fact that its cheaper for restaurants that way, if the waiters get paid mostly from tips. But then again, I'm not sure what happens with the tips. Do they go straight into the waiters pockets, or into the giant machine which is the restaurant?
I suppose it does encourage workers to do their best at all times, with the fear of losing the tip, and the promise of a reward in form of a tip if they don't screw up. But deliberately not doing your job well would get you fired here in Finland, so I'm really not sure if it's needed or not.
Overall seems like a pretty pointless custom.