I have been attending urban public schools since I was a child.
Because my parents are universities students, they can get the hukou of the city they are working in.
And, I just asked my mom about Hukou system.
Here's what my mom told me.
Migrant workers can get urban hukou if they buy a house in the city(or they are university students), then their children can enter public schools. If these workers don't have urban hukou, their children still can go to school in city, but only in private schools.
Urban public schools are financially supported by local government. The migrant workers that do not make much economic contribution to the city are not allowed to enjoy the local welfare. The same goes for people from other cities.
*Nowadays Hukou system does not have much practical use.