Hello! Super late to this because I wanted to see if someone else would provide a more in-depth answer, I can only speak to St. Louis and only at a wave-top level. There are multiple reasons for the split but I would argue the two biggest were taxation and political differences between people in what is now the county and now the city.
Taxation is pretty simple to explain. Residents in the city were getting taxed by the city AND the county for the same services (e.g. police) while county residents only paid taxes to the county.
Secondly, there was a big political (and ancestral) difference between city residents and county residents leading up to the separation. The county was largely made up of land owners, many wealthy, who came from the eastern United States and where typically either of French or Anglo-Saxon descent. The city's population was increasingly made up of immigrants from central Europe (Germans, Czech, etc.). Many of these immigrants were revolutionaries in the rebellions of 1848 and fled Europe when the revolutions were put down. They were pretty radical for their time. For example, at the outbreak of the Civil War the Federal garrison at Jefferson Barracks had to call upon a militia made up of these immigrants, orders given in German and everything, to block a confederate-aligned militia, made up of residents from mostly what is now the county, from taking the installation (Fun fact: some of these Germans went on have glorified army careers in the war while they maintained close contact with...Friedrich Engels. That's right, German immigrant communists helped defeat the Confederacy).
Sorry that's about all I have on the subject. I know Baltimore was used as an example for the separation but that's all I can do to link STL to your broader question. Walter Johnson talks about the differences between the county and the city often during his Broken Heart of America if you are interested. Go Blues!