Price(A) > Price(B)
=>
B > A
--------------------
Simplification aside, tipping is a service as well. The tipper "feels" good about tipping, the same way people donate or buy because of donations when there are such campaigns. For a lot of people the utility of that is close to 0, so they don't tip. For some its very high.
So it makes sense to have tipping as a way to implement price differentiation.