good students can switch tiers. and there are tierless schools too (gesamtschule) which allow any student with an average of grade 3 (C in the US system) or better to continue to high-school and qualify for university.
Correlation is pretty clear to me, causation less so. After a bit of searching around, I personally believe that the factors which make a particular neighborhood poor have a causal effect on the education outcomes in that neighborhood, but haven't found a clear causal link between school funding and education outcomes. I do think that increasing funding would help, but there are a ton of confounding variables which must be improved in tandem with funding to produce a significant improvement.
School funding goes toward teaching staff, school supplies (pencils, books, desks, chalkboards, etc.), food and water, and building maintenance (bathrooms, sinks, HVAC, etc.). There are also administrative staff, cleaning staff, and counselors i.e. school psychologists. In the case of K-12 public schools, taxes are the funding. Parents with lower income pay less in taxes (in literal dollars, not percentage-wise). Poorer school districts get less funding [1]. Less funding means fewer teachers or lower salaries. One article I read points out that teacher turnover is higher in schools with less funding and that higher turnover is worse for student learning [2]. While the article suggests that the turnover is at least partially due to whether the teachers are culturally and socially prepared to teach high-poverty student populations, increased funding could go toward providing poverty-aware training, training for resolving behavioral issues, and increased salaries to incentivize retention. ("Training for resolving behavioral issues" would include carefully assessing school policies to prevent a school-to-prison pipeline [3].)
On the other hand, a poor neighborhood has many other confounding factors which can influence student success. Poorer families are less able to buy healthy nourishment, and hunger distracts students in class [4]. Money problems distract parents from developing healthy, present relationships with their children. A poor neighborhood is less able to train police officers to deal with violence in the streets while also avoiding excessive violence in response. A poor city (or an indifferent state government [5]) can't account for or replace lead pipes and lead paint, and lead exposure harms brain development.