Some of this depends on your level of confidence....confidence in your children and in yourself and confidence to cope in the world.
Some people live in London but don't really like it. They don't like diversity and certainly don't like diversity for their children, although they probably won't ever say that. They feel much safer and more comfortable in a more homogenous environment and will make quite a lot of sacrifices in order to get that. Some are happy to have diversity when children are young, but as they get older, fear perceived issues at secondary level in terms of disruption at school, and issues with giving children more independence in a city.
So some people will move a distance away which will then involve a long commute for one adult, and the loss of city living (which perhaps they have tired of or never really liked, especially since they had children) and the burbs or the Home Counties look attractive for offering bigger houses, more green space and perhaps better schooling, and some areas will offer less diversity in racial terms, and they might imagine less in socio-economic too.
In fact, if you're going to state school, most schools have a fairly wide range in terms of socio-economic diversity, especially in more rural areas which have larger catchment areas. All areas have social housing and most secondaries have larger catchments than primary schools and a range of children. There will be a few that are significantly lacking diversity, but most have it if they are standard Comos admitting in distance. There can be less diversity within Church schools and in Grammars too, but your standard Comp with standard admissions criteria will have children from a range of backgrounds. If people are paying fees, that will be less the case. And lots of those moving out want Comps. Part if the moving out is to get a big house which still needs a big mortgage and fees aren't on the cards. Many don't want Grammar areas like Bucks or Kent because the secondary moderns aren't so good and there are no guarantees of a grammar place. Lots want a 'leafy comp' which they will get into on distance. The 'leafy' ones will be less 'mixed' but most leafy areas are bordered by less leafy ones and the children from there will go to the school too. And hang around in the places all the kids hang around.
Perhaps people choose to move out too, as a way to delay indepdence of teens. Kids in London travel by tube or bus to school, walk around the city and go out young to places in easy reach. Kids in the Home Counties might be more likely to need lifts to school or to meet their friends at weekends and this means more parental control for longer. Of course, it depends and lots of people live in towns in the Home Counties which offer more opportunities for a level of independence.
If you worry your child won't manage in a school with a range of behaviours, but is likely to struggle and be in lower sets with kids who might be disruptive, or who might get bullied, or who won't manage to get a bit streetwise, then you might see diversity as a negative and move to escape it. If as an adult you feel uncomfortable about different cultures or religions or lifestyles or financial expectations and keen for your children to mix with people like you, you might not feel confident about their future in London.
But other people are confident for themselves and their kids growing up in London and see a myriad of positives. They like to mix with a range of people themesleves and perhaps are involved in local communities where a range of people come together. They might have enjoyed meeting different families via primary school and feel their kids have benefitted from it. They might feel their kids will thrive in the schools becaue they are doing well academically and will continue to do so. They might feel confident that the values shown at home will be enough to ensure a good work ethic and not getting in with 'bad sorts' and they might have belief in their kids' characters already and can see that they are resilient and gain from a bit if a challenge. So they might stay.
I get why people go when their accommodation is very cramped and they can't afford bigger where they are living. But when one person or both have a local journey to work and moving will change at least one adults life I terms of the commute and the house is already perfectly adequate, I understand it far less, unless it is for some of these lack of confidence reasons.