The tip is usually given at the end of the service. How does that ensure a better experience during?
You're asking how a tip can influence a server, if they don't know it's coming. But in America they do know it's coming, at least, there is a cultural norm of tipping being expected. So it makes sense that a server would do what it takes, to make sure that it happens.
They see I'm American and thus have more purchasing power than locals. They want some of that sweet sweet money, so they treat you better.