Many countries in Europe are closing their borders to refugees after a spur of right-winged political movements. However, the principle of non-refoulement states that a state must accept someone who is escaping a well-founded fear of persecution. How does this work?
How does this work? By instructing immigration officers, border-guards, military, police or other government branches to prevent refugees from crossing the border.
Of course there are international treaties which would theoretically outlaw this practice, but international treaties are only effective when other states are willing to enforce them. When they do not feel that it is politically wise to get involved (or even in their interest to not get involved, for example because the refugees would move on straight to them when allowed to enter the European Union), they won't.
Note that most of the EU border states haven't officially closed their borders to refugees. They rather insist on refugees passing the border in an ordered and controlled manner where each refugee is registered properly. This of course takes its time because the number of refugees which can be processed that way per day is limited.
You have answered your own question by quoting UNHCR definition: "No Contracting State shall expel or return ("refouler") a refugee in any manner whatsoever to the frontiers of territories where his life or freedom would be threatened on account of his race, religion, nationality, membership of a particular social group or political opinion."
A person from Syria is seeking refugee in Turkey. He is now safe from persecution. However if he wants to move from there to let's say Austria, they can refuse him. He is safe in Turkey. By moving from Turkey to Austria he is not "escaping a well-founded fear of persecution". By not admitting him from Turkey, Austria is not "returning a refugee [...] to the frontiers of territories where his life or freedom would be threatened".