Over here our schools have numerous tracks, and kids who are not very into bookwork (I don't know any better PC word) take a lower-level course of EFL than kids who go into college-prep. College-prep kids are also placed into two groups: science college-prep and humanities college-prep, and it is the latter group that gets the best EFL education. The non-col-prep kids are the ones that are most likely to end up in community college versus going directly to university. Therefore you would get our lower half? of students, who are basically not into studying and therefore have large holes in their English knowledge.
Their HS teachers are probably giving best grades to their best students in the bunch (sort of curving the grade) so if a kid is a blabbermouth who knows many English words from movies or songs but seriously struggles with grammar, he/she can still be the best in your class/track and they give him/her an A. Most of the classmates would not get into community college at all, so your school actually gets the best of the lowest group.
About the kids' perception of their English abilities: they are probably speaking English better than anyone else they know (except the teacher) so they can not realistically judge their knowledge. They are probably immersed in some other language all day outside of school, talk their own language around family and friends, and have no real use of complex grammar, so they don't practice it.
About the rich vs. poor districts - it is a tradition that a rich person will pay a tutor if the child struggles in certain subject (this is mostly the case with math and physics). There are numerous small-group English courses advertized in vicinity of school buildings, aimed at young elementary students, so anyone who can afford to pay (they are not cheap) sends their child to learn English from a very young age. Those who can not afford it must learn English only in school, and there they must sit in a classroom with 30 other kids, waiting for their turn to say a sentence.