How much are local (same state or country) applicants favored in PhD admissions? How protectionistic are PhD admissions?

Here, protectionism means to favor residents of the country (or state) the university is in, as far as PhD admissions are concerned. Usually, protectionism arises due to funding restrictions or other burdens of a financial nature (e.g. tuition waivers). 

But how much of a disadvantage are foreign students at, when it comes to PhD admissions?

I understand that the answer differs from a country to another, and from an institution to another within the same country. And even different fields within the same institution have different standards, so please pay attention to context when providing answers.
In the UK, in STEM areas without industry funding (where I have most experience), funding restrictions typically meant there are at least 10 places restricted to home (or in some cases EU) students for every place open to students of all nationalities.