The jobs are in the city because the people are there, and the people are there because the jobs and other people are there. Empirically, both residents and employers prefer to relocate to the city.
The city is convenient and fun: it provides easier transportation, more amenities, more other people to engage with, more companies of all types to do business with, etc.