Nobody really knows. A mixture of their environment, parenting, and genetics probably. I don't know what extent of which and I don't think anyone does.
One would wonder what could be behind that... Also, poorer schools in poor neighborhoods because they receive less funding, lowering the value or real estate in the neighborhood, attracting poor people to it.
Oh wow, if nobody really knows that sounds like a big problem we should solve! Maybe we should fund research into that. And maybe fund programs to alleviate the environments that were created. I'm sure anyone who wants America to be a true meritocracy wouldn't be rooting out this big unsolved problem.