City pigeons are descendants of rock pigeons, more accurately called rock doves. They are the same species and can still interbreed. The natural habitats of rock doves are cliffs and rocky outcrops.
Nearly every city on earth has large populations of pigeons, no matter their distance to cliffs or rocky outcrops. This is because, for thousands of years, it was very advantageous to keep large populations of pigeons. They were a more or less labour-free source of meat and fertilizer. All you had to do was build a dovecote (a sort of artificial cliff made from bricks), introduce a few baby rock doves from some coast somewhere, and things would look after themselves. The pigeons would never leave if you raised them in the dovecote from chicks.
The agricultural and industrial revolutions put an end to all of this. Pigeons were especially valuable as a source of food during winter, but we realised in the late 19th century that you can just live on turnips until spring if you plant them in the autumn. Advances in chemicals manufacturing ended our reliance on pigeon faeces as a source of cheap fertilizer. Pigeon meat held out for a while as the main form of poultry, but even this ended after we discovered how to factory farm eggs (which dramatically lowered the value which we ascribed to the lives of chickens).
Gradually, we abandoned our dovecotes. But conveniently for the pigeons, at around the same time we stopped building dovecotes, we started building even bigger artificial cliffs out of concrete. So the pigeon populations remained.
It is easy to see the life of a city pigeon as a tragedy. There is something about their existence that just feels inherently depraved, their surroundings so far removed from the colourful serenity of the environments they spent thousands of years acclimating to. And indeed, city pigeons face real challenges. Rock doves are never hit by cars, are not stained black inside and out by poisonous exhaust fumes, never lose toes to tangled knots of hair and plastic.
But in many ways these new concrete cliffs are the best cliffs there have ever been. They are always warm and sheltered, and there is no shortage of good spots. Rock doves will often just die if their crevice collapses due to erosion, or gets flooded by a rogue wave. There are no peregrine falcons or other raptors hunting you down. No city pigeon lives to see its mother torn limb from limb by a bigger bird. And food is, for all intents and purposes, infinite and free. Rock doves experience famine every winter when the seeds and grasses they rely on freeze over.
A pigeon doesn't look at a building and see it as a gross, ariticial, dystopian simulacrum of a cliff. A pigeon doesn't see a building at all. A pigeon just sees a cliff. They see a warm, sheltered, inviting cliff, with enough nesting spots to house them and three generations of their descendents. They roost in their homes and tilt their heads back as the crashing tidal waves of the cars and trains beneath them ricochet off the walls and ruffle their feathers. They look out over a hot night sky of stars twinkling red and green, with yellow and white lights rippling over the oceans beneath them. They smell the smoky, food-laden air, and when they sleep they dream of the terrifying raptors they know only from folk tales passed down to them. They wake up to a valley of rocks, purring quietly, tinged at all sides with branches full of leaves, and wonder if the raptors were even real.