People who work in coffee shops do so for a short time, not 8-10 hours every day in the same shop at the same desk with the same people around for the entire time. They know that nobody there is talking about work so the background conversations are never going to be relevant or important. They know that nobody is walking up to them to interrupt them, so almost any motion they see can be ignored. They know that anybody looking at them is not a manager judging their productivity right now. Big parts of their brain can relax.