The San Francisco Bay Area and Seattle are the two biggest hubs of the U.S. tech industry. Not surprisingly, they have been among the fastest-growing parts of the country in recent years. In fact, the San Francisco, San Jose, and Seattle metropolitan areas account for 3 of the 4 strongest regional economies in the U.S., according to Business Insider.

Despite this breakneck economic growth, both the Bay Area and Seattle have been hit hard by Macy's (M -0.49%) store closures and store downsizings in recent years. Let's take a look at why the No. 1 department store chain is shrinking in these fast-growing markets.

Rapid downsizing

Over the past five years, Macy's has significantly reduced its footprint in the Bay Area. In 2015, it closed its store in Cupertino. In early 2018, it closed a furniture store in Novato (in the North Bay area) and a full-line store at Stonestown Galleria in San Francisco proper. Last September, it closed its men's store in downtown San Francisco.

Right now, Macy's Sunnyvale store is in the midst of a final clearance sale. The company is also preparing to shrink its San Francisco flagship store, and recent local media reports indicate that Macy's is planning to close its men's store in Palo Alto.

The exterior of Macy's Union Square flagship store in San Francisco.

Macy's recently sold a portion of its San Francisco flagship store. Image source: Macy's.

The downsizing has been somewhat less stark in Seattle, but unmistakable nonetheless. In the past few years, Macy's has shrunk the size of its downtown flagship store by about two-thirds. Additionally, Macy's is in the midst of a final clearance sale for its Redmond full-line store and has already announced that it will close its store at Seattle's Northgate Mall next year.

Check out the latest Macy's earnings call transcript.

Weighing the real estate against the business

Macy's retrenchment in the Bay Area and Seattle doesn't mean the retailer is doing especially poorly in those markets. Instead, it is reacting to several important changes in the retail and real estate markets.

First, mall traffic has been falling, particularly at lower-quality malls. Second, the rise of e-commerce means it's no longer essential to blanket the country with stores just for the sake of convenience. Third, real estate values have soared over the past decade -- especially in the Bay Area and Seattle. The result is that in many cases, the profits Macy's can earn from continuing to operate a particular store can't match up to the value of the underlying real estate.

Indeed, Macy's has collected an enormous amount of cash in exchange for downsizing in these regions. It received a total of $115 million for the upper floors of its Seattle flagship store. It sold the ground lease for its Cupertino store for $32 million. Its mall-based stores in Sunnyvale and San Francisco sold for $40 million and $41 million, respectively. Most notably, Macy's brought in about $250 million from selling the Union Square men's store and recently received a similar amount for a 240,000-square-foot piece of its main San Francisco flagship store.

Even where it hasn't received huge sums for closing stores in the Bay Area and Seattle, high real estate values may be accelerating Macy's downsizing initiative by driving up rents. Of all the stores discussed above, the only location that appears to have been closed purely due to underperformance was the Redmond, Washington, store.

There could be more ahead

By and large, Macy's store closures in Seattle and the Bay Area have spared its best stores in those markets (although it has shrunk its flagship stores). Even after its ongoing downsizing in Seattle, it will operate stores downtown and in the three best malls in the region, plus a handful of stores in lower-tier malls in the more distant suburbs.

In the Bay Area, Macy's has an even broader footprint, with more than 15 remaining full-line stores. That could mean there will be more downsizing in its future.

For one thing, the company could potentially close another one or two Bay Area stores in mid-tier malls where there are more profitable Macy's locations nearby. Furthermore, several of the best malls in the region have two Macy's stores each. That means the retailer has an opportunity to close and sell one store while still maintaining a presence in each of those malls.

Given that it can already offer a broad selection online, Macy's might benefit from reducing its square footage, which would force it to carry a more curated assortment of items in its stores. And considering the value of Bay Area real estate, Macy's could probably reap a huge windfall by further paring back its store portfolio there.