What’s unusual about St. Louis — and goes a long way to explain the tension of the Ferguson protests — is not racism per se but the way the metropolitan area has chopped itself into bits, remaining socially and economically segregated long after racist laws were erased from the books.

There are neighborhoods where people live their entire lives and keep out strangers, with stone-pillared gates that seal off mansion-lined private avenues. The Mississippi and Missouri rivers have been used as racial divides. And artificial boundaries carve St. Louis County into 90 separate municipalities, many of which can’t afford good schools and representative, highly trained police departments. Yet the municipalities refuse unification with one another and the city of St. Louis.

Ferguson, tucked into North County, is one of those tiny cities, with a population of roughly 21,000. Its mayor has expressed some guarded openness to a city-county merger, though there’s a strong sense of community and identity in Ferguson (the upside of fragmentation).

Still, Colin Gordon, author of “Mapping Decline: St. Louis and the Fate of the American City,” called Ferguson “a postage stamp municipality in which the white population still clings to the levers of power,” despite a population that has shifted from about 25 percent black to two-thirds black in just two decades.

“It’s part of a crescent of municipalities between the city and the airport that are not really suburbs,” he said. “They look much more like the city in the size of the lots and the mix of the land use. When flight begins, this becomes a zone of transition, because it’s the sole pocket of affordable housing.” Transition, he pointed out, is a point-in-time measurement; it doesn’t necessarily signal healthy integration.

Nor is transition easy in a city that has been finding ways to control black people’s movements since the 1700s. Today’s rules are about curfews, sagging pants and evening protests. In the late 1770s, Spanish colonial ordinances restricted slaves from holding nocturnal assemblies, dressing “in barbarous fashion” and leaving their cabins.

During the Civil War, St. Louis was a tense place. Many of its white residents came from the upland South, and the Mississippi River kept alive cultural and economic ties to the South. After the war, the black population stayed a stable 6 percent for several decades, concentrating in wards by the river and on the edge of downtown. But then came the Great Migration, a huge influx of Southern blacks heading north. They reached St. Louis just after a wave of Italian, Greek and Polish immigration — and a decrease in jobs.

In February 1915, a letter went out to white homeowners: “Dear Neighbor: DO YOU REALIZE that at any time you are liable to suffer an irreparable loss, due to the coming of NEGROES into the block in which you live or in which you own property?”

A group of St. Louisans wanted to use the reform provision in the city’s newly revised charter to enforce racial segregation. Despite opposition from the mayor and vocal politicians and church leaders, St. Louisans voted — 3 to 1 — to prevent blacks from moving into any neighborhood that was already 75 percent white (or vice versa). In 1916, St. Louis became the first city in the nation to pass a segregation ordinance by referendum.

A 1917 U.S. Supreme Court decision made that ordinance illegal. So white St. Louis homeowners began using racial covenants, securing promises from all neighborhood residents never to sell to a black person.

In 1948 the Supreme Court made the racial covenants illegal. So suburbs quickly put exclusive zoning restrictions into place, requiring large single-family lots. Banks made mortgage policies accordingly. Developers learned about blockbusting, and real estate agents learned to steer their clients’ flight from the city.

In the 1960s, before his rise to police chief and then mayor of St. Louis, Clarence Harmon tried to move into a new development, Paddock Woods, in North County’s Florissant municipality. He said he was told politely, “Well, sir, we are not selling homes to Negroes up here. There’s a case coming up before the U.S. Supreme Court” — Jones v. Mayer, resulting from Joseph Jones’ unsuccessful attempt to buy a house in Paddock Woods — “and that will determine whether we do.” Jones won his case, and Harmon moved in.

Years later, a friend of Harmon’s, an FBI agent, was planning to move to St. Louis and called a real estate agent about a house in Florissant. Not realizing he was African-American, she murmured, “Oh, you don’t want to live up there. All the blacks live there.”

John Wright, former assistant superintendent of the Ferguson-Florissant school district, remembers a chain stretched across a road to cut off access from the black city of Kinloch to then-white Ferguson. Wright is now retired and is a cultural ambassador to Senegal. “I tell people I grew up in an apartheid town,” he said. “The only two places I remember being able to go were the public library and the St. Louis Zoo. Everything else was determined by where you lived and your skin color.”

There are two reasons St. Louis looks the way it does today, noted Michael Allen, director of the Preservation Research Office. “There’s been this perpetual, successive flight of white and middle-class people from the core of the city, and the same relationships tended to reconstitute themselves across a wide swath of geography. The city’s tensions very quickly re-emerged in North County, and the trajectory suggests that they will re-emerge in St. Charles County,” the next stopover on the flight path. “The flashpoint keeps moving further from the center of the city, but it’s still the same flashpoint.”

Blacks and whites are also separated psychologically, Allen added. Starting in the days of slave ownership, “there was always this white fear of franchise and agency. What would happen if the slaves revolted? If they got the right to vote? If thousands came and took our jobs? If they lived next door? If they came to the suburbs we built to get away from them? Or the suburbs we built to get away from those suburbs?”

In reaction, St. Louis “has spent enormous sums of public money to spatially reinforce human segregation patterns,” Allen said. “We tore out the core of the city around downtown, just north and south and west, and fortified downtown as an island, by removing so-called slum neighborhoods. Then we demolished vacant housing in the Ville [where rocker Chuck Berry and opera singer Grace Bumbry grew up] and other historic black neighborhoods. These were not accidents. These were inflicted wounds.”

Many black residents wound up renting, moving often and never acquiring home equity or savings to bequeath to their children. The areas where they lived had no tax base, inadequate schools and no appeal to local businesses that could have provided jobs.

“Black communities in urban areas don’t have Whole Foods. They don’t have Starbucks. They don’t have work,” said Gerald Early, director of African-American studies at Washington University. “And that goes back to legalized segregation. They were basically set up to not be able to compete with white communities, to remind people every day that they were inferior to whites.”

Early blamed St. Louis’ geographic fragmentation for “exacerbating segregation. The fragmentation tends to go along racial lines. If St. Louis City were 90 percent white, the county would say, ‘Yeah, that’s cool, let’s have a merger.’ But unification is not taking place for racial reasons, and African-Americans are very aware of that. In essence, they are being told by whites, ‘We don’t really want to be with you as citizens.’”

St. Louis might look inclusive; the city has had two African-American mayors, and the county has had an African-American chief executive. But “electoral politics promised more than it ultimately delivered, because power is diffuse,” Early said. “It’s in the economic realm. It’s in the cultural realm. And in those areas in St. Louis, black people have very little power and very little influence. They have very little presence.”

“St. Louis feels a little Southern, and some of the white people have a kind of Southern, genteel, patrician way about them,” he continued. “If you are part of the white elite, you are saying, ‘We are doing things for you. We are trying to help. We have this or that special program for you.’ But clearly, after a while — and I think the blowup in Ferguson is a perfect example — people get angry, and they get fed up, and those things are not enough.”