Atherton has had the Bay Area’s highest home prices for at least a decade, but in recent years it has surged way ahead of its peers to become the most expensive ZIP code in the nation, a fact that’s often touted in real estate listings.

The town’s ascendance stems largely from its single-family zoning, 1-acre-minimum lot sizes, flat land, streamlined permits and changing buyer demographics — which have translated into soaring house sizes and skyrocketing prices.

“It’s a whole new level of money, since I was a kid,” said Keri Nicholas, a real estate agent who grew up in Atherton in the 1970s. “Now people have drivers, have chefs.” Her 5,000-square-foot childhood home is surrounded by ones that are “10,000-plus.”

The median price of a home sold in Atherton in the first half of this year was nearly $8.1 million, according to CoreLogic. That’s almost twice as much as the Bay Area’s next most expensive cities: Los Altos Hills, with a $4.5 million median, and Hillsborough, at $4.25 million. Ten years ago, Atherton’s median price was only 9% and 19% higher than those two cities, respectively.

The three Peninsula cities have much in common. Their populations are similar, ranging from about 7,000 in Atherton to 11,500 in Hillsborough. They all have no land zoned for multifamily housing or commercial activity, although they do have private country clubs in areas zoned for open space or recreation.

This is unusual, but not unheard of: 28 California cities and unincorporated county areas that responded to a survey by the Terner Center for Housing Innovation said they had almost no land (5% or less) zoned multifamily. They represented 10.5% of respondents.

Historically, Hillsborough is where the families of San Francisco’s 19th century business tycoons built grand estates. Its architectural landmarks include mansions built in the early 1900s by banking magnate and railroad scion William Crocker, railcar heiress Harriett Pullman Carolan and George Hearst, son of newspaper publisher William Randolph Hearst.

Atherton is also an old town, incorporated in 1923, but its real wealth came later, from Silicon Valley and the venture capitalists who funded it.

“Atherton was a sleepy town,” said Coldwell Banker agent Pierre Buljan. He recalls having a hard time selling eight lots on Valley Road in the late 1980s. “Hillsborough was always the preferred town because it was closer to San Francisco, until the last 10 or 15 years, as Facebook and Google went public. You had so many buyers coming out of Google they called Atherton Avenue Google Avenue for a while.”

Today, buyers include a mix of “foreign money, tech money, doctors and lawyers, and inherited money,” said Elyse Barca, a Compass agent and Atherton resident. It’s also popular with sports figures, including Jerry Rice, Willie Mays and Warriors majority owner Joe Lacob. Several agents said Stephen Curry has bought a property there.

Atherton’s flat, shady streets are lined with majestic oaks and towering redwoods. Nearly all the big homes have gates, and more than a few display American flags. Caltrain ended weekday train service at the Atherton station in 2005 because of financial constraints and low ridership.

Atherton is warmer and less windy than Hillsborough. But unlike Hillsborough, which has its own highly rated K-8 schools, Atherton has no public school district all to its own. Its kids are assigned to Redwood City or Menlo Park districts, or the Las Lomitas district shared by Menlo Park and Atherton, although many go to the private Menlo School and Sacred Heart Schools in the city.

In the 1990s, when Silicon Valley was dominated by computer hardware companies, monied buyers “wanted acreage, separation” and preferred suburbs with a rural feel such as Woodside, Los Altos Hills and Portola Valley, Peninsula Realtor Ken DeLeon said. “As Silicon Valley became more search and social networking,” companies recruited from urban areas and buyer demographics changed. Along with privacy, they wanted “walkability and centrality.” Atherton is minutes from downtown Menlo Park, Palo Alto and Redwood City.

The wealthy are also drawn to Atherton because its police force is “almost like private security,” DeLeon said.

Atherton Mayor Bill Widmer said about half the town’s residents have their alarm systems wired into the police station, and when they’re on vacation, officers will drive by to check on their homes.

A big reason for Atherton’s soaring median home price is an increase in gargantuan homes, made possible by its building and zoning regulations and flat terrain.

Atherton requires that homes be on at least 1 acre, except on a few streets with smaller lots that existed before the requirement. Hillsborough’s minimum lot size is generally a half acre. Los Altos Hills also has a 1-acre minimum, but it and Hillsborough are hilly, making it harder and more expensive to build massive homes, especially in earthquake country.

“The allowable square feet and lot coverage is more generous in Atherton” than in many surrounding cities, Peninsula architect Roger Kohler said.

There are five homes for sale in Atherton ranging from 11,155 to 15,600 square feet. By comparison, Hillsborough has no homes larger than 11,000 square feet on the market and Los Altos Hills has only one — a 21,000-square-foot megamansion. (This excludes homes not advertised on a Multiple Listing Service. In San Mateo County, almost 20% of homes sold in the first quarter were not marketed on the service, according to MLSListings.)

These homes are small compared with two 30,000-square-foot homes under construction on Tuscaloosa Avenue in Atherton. One is being built by Pacific Peninsula Group. The luxury home builder is also building two spec homes at 336 and 338 Walsh Road that will be 17,582 and 11,399 square feet, respectively. This month, it bought 46 Linda Vista Avenue, an older home on 1 acre for $7.2 million, according to public records.

In an article last year, De Leon wrote, “Atherton’s building codes and regulations are much less restrictive than nearby cities such as Woodside.” As evidence, he pointed to Stockbridge Avenue west of Alameda de las Pulgas. “The southern side of the street is Atherton and is almost completely rebuilt. Whereas the northern side of the street is Woodside and consists primarily of the original 1950s ranch-style homes. It is not a coincidence that Atherton has appreciated at a much more rapid rate than Woodside.”

Widmer said Atherton requires builders to follow California uniform building codes. But it does not impose more stringent standards, such as “reach codes” that require greater energy conservation and less greenhouse gas emissions.

The privacy-obsessed town does require homeowners to screen their side yards from neighbors and allows 6-foot solid walls along the front of homes, which is higher than many cities permit.

It does not have an architectural design review committee. In many cities, these committees can demand or recommend changes to designs that are not compatible with the community’s character. Hillsborough and Woodside have them; Los Altos Hills disbanded its committee in the 1980s.

In Atherton, “a culture of private property rights prevail,” said Lisa Costa Sanders, the town planner. As long as you meet zoning, setback and height requirements, “you can build whatever home you want.”

The lowest-priced sale in Atherton this year was an 8,900-square-foot vacant lot at 307 Walsh Road that just sold to a developer for $2 million. The next-lowest was 286 Selby Lane, a 1,290-square-foot home on 5,000 square feet in one of the few areas with lots that small. It went for $2.2 million.

The highest sale was 58 Tuscaloosa Ave., a 12,494-square-foot spec home that sold in March for $23.1 million, then again in June for $25 million.

About half the homes being purchased in Atherton are being torn down and replaced with bigger ones, “the highest ratio in the region,” DeLeon said. “Prime lots cost $8 million just for the dirt. I’ve had clients tear down homes of 8,000 square feet” to build a bigger one, De Leon said.

A big, new home raises the value of surrounding homes and creates an incentive to knock them down and build bigger ones. “It feeds on itself, almost,” DeLeon said.

“The 1950s, ’60s, ranch homes, they are going through those like cigarettes,” said Peninsula real estate broker Denis Morrissey.

Over the last four years, WhatsApp co-founder Jan Koum paid $57 million in five transactions “to assemble a monumentally scaled Atherton compound,” Variety reported last month. “All five of the houses he acquired have either been razed entirely and replaced with all-new structures, or radically reimagined.”

Atherton City Manager George Rodericks said the lots appear to be at Polhemus Avenue and Fleur Place, and it’s not the only compound in town.

Like all California cities, Atherton is supposed to create new housing for people of all incomes — from very-low to above-moderate income — under what’s known as the Regional Housing Needs Assessment. That’s hard to do when your land is zoned almost exclusively for single-family homes on 1-acre lots, and people are tearing down houses to create compounds.

Atherton’s goal for the current cycle — 2014 through 2022 — is 93 units. That consists of 61 units for people of very low to low income, 29 moderate-income units and three above-moderate homes. The town has to identify sites without development barriers where these units could be built, but doesn’t have to build housing itself, Sanders said.

For the three high-end homes, it identified more than 110 parcels, mostly multi-acre lots that could be subdivided.

All other categories, it said, could come from the creation of 79 units for students and faculty at Menlo College, 11 for faculty at Menlo School and 40 second units, such as backyard cottages. Its zoning allows multifamily housing on school property and second units of limited size on single-family lots.

“Second dwelling units in Atherton provide needed extremely low income and very low income housing,” it said in its housing plan, because “occupied second units in Atherton tend to be made available at low or no cost to family members or domestic employees.”

Through 2018, the town had approved 40 units of very-low and low-income housing, three moderate-income units and 59 for above-moderate income.

It wouldn’t say where or what kind of low- and moderate-income housing has been created, but it’s not at Menlo College. The college wants to create more on-campus housing, “but we don’t have funding or detailed drawings,” its President Steven Weiner said.

Editor’s note: This story has been updated to clarify the school districts that serve Atherton.

Kathleen Pender is a San Francisco Chronicle columnist. Email: kpender@sfchronicle.com Twitter: @kathpender