The city is a habitat
Urban fabric is not broken countryside. Walls, verges, ballast and rooftops are dry, alkaline, frequently disturbed environments — and they have specialists that live nowhere else.

Reading the city as ecology
The instinct, walking through a town, is to treat the built fabric as an absence: ground that used to be something else, now covered. That instinct is wrong. Concrete and stone create conditions — shallow, sharp-draining, alkaline, exposed to full sun and radiated heat — that closely resemble certain natural habitats. Limestone pavement, coastal shingle, inland cliff faces. The species that colonise a wall or a railway cutting are not refugees from the countryside struggling in a hostile gap. Many of them are dry-ground and base-rich specialists doing exactly what they are built to do.

The analogy with rock habitats is not loose. Mortar, concrete and brick all weather to a high pH. Many urban substrates also heat rapidly and cool rapidly, staying dry well into periods when surrounding soils hold moisture. The plants that persist there — wall-rue (Asplenium ruta-muraria), ivy-leaved toadflax (Cymbalaria muralis), pellitory-of-the-wall (Parietaria judaica) — are not weedy generalists in the pejorative sense. They are lime-tolerant, drought-adapted, often rupestral species: plants of rocky outcrops that have found, in urban masonry, a very long and continuous chain of suitable surfaces.
What the disturbance creates
Urban habitats are not stable. That is part of what makes them productive for colonisers. A road verge gets cut on a municipal schedule; a flat roof accumulates dust, dies back, accumulates more; railway ballast gets disturbed by maintenance, reballasted, colonised again. Disturbance at intermediate frequency keeps competitive grasses from closing over and suppresses the development of deep leaf-litter. The result is a mosaic of open, bare and partly vegetated surfaces — conditions that pioneer species exploit with speed and efficiency, and that the city keeps resetting.
The invertebrate ecology follows the same logic. Solitary bees that nest in crumbling mortar or bare compacted soil are not adapting to an alien environment; they are using the same substrate cues they would use on a south-facing earthen bank. Black redstarts (Phoenicurus ochruros) breed on industrial brownfield in Britain precisely because rubble and sparse vegetation mimic the rocky slopes of their original Continental range. The city, read ecologically, is a network of surrogate cliff, shingle and open heath — stitched together by road, rail and wall.

Dry, alkaline, exposed
Three physical conditions define most urban substrate ecology, and they interact. First, alkalinity: lime leaching from concrete and mortar raises soil pH well above what most agricultural land sustains, favouring a suite of calcicoles — calcium-loving plants — rarely encountered in lowland acid grassland. Second, drainage: even shallow soil over impermeable surfaces dries quickly after rain; the moisture regime resembles the thin soils of rock ledges more than it resembles a garden border. Third, exposure: walls and roofs sit above the insulating effect of ground cover, subject to wind, UV and temperature swings that sheltered lowland habitats rarely impose.
These same conditions are why an old, lime-mortared wall can hold forty or fifty species of plant, lichen and moss across its surface, from the damp base where liverworts persist in a perpetual splash zone, to the cap stones where only crustose lichens grip the bare mineral. Wall flora of this kind takes decades to develop; repointing in Portland cement destroys it overnight by sealing the habitat and raising surface pH past the tolerance of most bryophytes.

The urban environment is not uniform. A north-facing brick wall is a different world from the south-facing face two metres away. A green roof with fifty millimetres of substrate behaves differently from one with a hundred and fifty. The city contains hundreds of microhabitats at walking-pace distances, and the skill of reading it is learning to see substrate, aspect, drainage and disturbance history as the primary variables — the same variables that matter anywhere else in field ecology, on any ground at all.