We do not live in a global culture that is shaped by freedom’s triumph over tyranny. Rather, we live in a global culture where the two have merged. If we are to speak freely, every word must be monitored. If we are to roam freely, every entrance must be locked.

And yet, within our walls, like fertile soil forming in the crevices of a rock, we find flux and fluidity. The United States will one day soon have a nonwhite majority. Some European cities, like Rotterdam, are nearing a similar shift. We are drawn, despite ourselves, to otherness. In the centuries of colonialism, northerners once spread to the global south. In the decades since colonialism, southerners have spread to the global north. And northerners are mixing, too, with other northerners who are strangers to them, southerners with southern strangers. There is planetwide, gyrating churn. Dubai, a city on the Arabian Peninsula, is peopled mostly by Indians and Pakistanis.

Lahore is a place that embodies the magnetism of difference: It is the site of remarkable mixing despite sniper-­guarded schools and high demand for razor wire. Many people leave Lahore, but even more, they come. Since the year of my birth, 1971, the city has more than tripled in population. Today it has nine million inhabitants. Some of these are the children and grandchildren of Lahoris. Most are not. My wife and I are both Lahore-born, but even the most cursory look into the past is enough to reveal our migrant roots. My mother’s family comes from the south of the province, near the deserts of Rajasthan. My father’s comes from the valleys of Kashmir and a part of Punjab that is now in India. My wife’s maternal grandmother came from Italy, from the hills of Piedmont, to be precise. My wife’s father’s family are Kakezai, people who journeyed centuries ago from Afghanistan and settled in Punjab.

Like all great cities, Lahore is a lake into which rivers of humanity flow. Barricades erected out of fear have done little to block this: The migration is gathering pace. The Lahore of my childhood ended in croplands not far from my house. Now it stretches unbroken for many miles in every direction. I live in a 60-year-old single-story home built by my grandparents, typical of the bungalows of our once-sleepy neighborhood. But new office towers soar all around it. Houses once inhabited by my playmates, or by pretty girls I glimpsed each day from my bicycle as I pedaled by, are disappearing with wrenching shudders into construction pits, to be replaced, seemingly overnight, by shopping malls.

I see increasing numbers of Pashtun faces in the markets, people displaced from the conflict-­ridden northwest of the country and from Afghanistan. I hear village accents in the clinics, people drawn to modern medical care and amen­ities. I watch newly arrived families, with all their possessions bundled on their heads, crossing dangerously busy intersections in violation of traffic lights, pulled here by the promise of work. I speak to Christians who have come from midsize towns in the hope that they will find less bigotry and intolerance in the big city. Now on each street there is something or someone new: a diner run by a woman from Korea, an Imax movie theater with the beams of its promotional spotlights wheeling in the sky, a tiny kiosk that refurbishes scrap cellphones and sells them for less than the cost of a refill card.

In Lahore, chauvinisms are rampant, and the city has had more than its share of bleak moments: the religious massacres accompanying the partitioning of the subcontinent in 1947, the terrorist attacks and sectarian assassinations of today. The ancient Lahore Fort — sunset red, its ramps wide enough for war elephants — is a truly mighty structure, the city’s biggest wall of all, and it is a reminder that this is a settlement often in the path of conquest. But despite the bloodshed it has witnessed, Lahore has managed for centuries to give millions of the displaced a home, and more than that, to be a place of fragile yet stubborn cosmopolitanism, a place of artistry and education. Today, as has ever been the case, the city’s most visited shrines are dedicated to mystics and writers.