The state does not "compensate" for the fact that wealthy city school districts simply fund their schools under the table with massive PTA budgets, and there is not a lot the state can do about that in the short term without significant tax reform.
Three adjacent school districts, in descending order of household income and grade-level performance: Piedmont (90% at-grade-level), Berkeley (67%), Oakland (33%).