There must have been a great deal of horses in cities like London, and with overpopulation such a problem in the 19th century where were all those horses housed?
Here's a cool clip from the 19th century: https://www.youtube.com/watch?v=fkHMwPeG1LY
Horse ownership was nowhere near as ubiquitous as auto ownership today. The figures I have handy (from Clay McShane's book Down the Asphalt Path) are for big US cities, and they indicate about one horse for every 23 people. Nearly all of those were owned by businesses for delivery purposes, and those businesses did have stable buildings in industrial areas or lower-rent districts near downtown.
Only a few very wealthy families had their own horses, carriages, and stables.
It was uncommon to own horses (England 17th-early 20th c) , but it was quite common to hire them as one would hire a hire-car today. Hence the origins of pub names like 'the Coach House' these establishments were once combination Inns and stables where travellers could rest one horse and take another on their onward journey.
There's a pub near me that still has signs up warning punters that horses left unattended and not stabled are liable to be sold by the Landlord.