Separation does not happen organically. Rich people and governments are in charge of city planning and they make wrong decisions based on making profits.
In city where I live some rich dude contributed to our city governor’s campaign or something. Now governor has to “return the favor” by relocating thousands of government employees from downtown area which is close to a lot of people’s homes to outskirts of the city where nobody lives and where that rich dude owns office space for rent.
It's doesn't happen organically. It is usually designed by city planners (or equivalent functions depending on the city). It makes most sense to have mixture of residential and commercial buildings in the same area so that there is no foot traffic vacuum depending on the time of the day. Foot traffic vacuum creates space for potential crimes.
(e.g, if you separate commercial and residential, the commercial area will be more likely crime ridden at night and residential area will be more prone to crime during the day).
The environment needed for maximizing work is often at odds with the environment for maximizing leisure.