you keep the receipt, that way if you are charged wrongly you just sent the receipt to your CC and chargeback the restaurant.
it has happened to me a few times, maybe once every 2-3 years, the server will decide I didn't tip enough and my 10 dollar tip becomes 100 dollars. often they can get away with this because a lot of folks never check their receipts.
you are supposed to tip based on service level. it's entirely subjective.