TLDR: all ordinary UK residents, non-ordinary-residents who've been living legally in the UK for >12 months, EU citizens with EHIC cards, and various other sets of people.
Treatment at A&E (accident & emergency), family planning & HIV tests, and for certain communicable diseases is always free no matter who you are, for practical reasons (no time to ask who you are in A&E before they treat you, no requirement to ask who you are for family planning & HIV tests for confidentiality reasons, and for communicable diseases you want to minimise their spreading).
Emergency treatment is free literally for anybody regardless of length of stay. You have to be able to demonstrate that you are a normal resident in the UK intending to stay for at least 6 months to register with a GP (student / working here is fine). Basically the only thing they care about is that you aren't a health-tourist.
No. It doesn't necessarily cover illegal immigrants, and may not necessarily cover legal immigrants, or those present on work visas.
This will likely be challenged (along with many other tenets of it) shortly though, as there have been other resident alien cases regarding civil rights (voting, guns) wherein the decisions pretty routinely fell on the side of the alien, whether they were here legally or not.
TLDR: all ordinary UK residents, non-ordinary-residents who've been living legally in the UK for >12 months, EU citizens with EHIC cards, and various other sets of people.
Treatment at A&E (accident & emergency), family planning & HIV tests, and for certain communicable diseases is always free no matter who you are, for practical reasons (no time to ask who you are in A&E before they treat you, no requirement to ask who you are for family planning & HIV tests for confidentiality reasons, and for communicable diseases you want to minimise their spreading).