If you could only keep one office in China, where would it be? Would you prefer Beijing, the capital and political center of the nation? Or would it make more sense to be in Shanghai? Sheppard, Mullin, Richter & Hampton recently had to make that decision, and they went with Shanghai. The coastal city, the firm said, is the more logical location for its cross-border M&A and IP practices. Sheppard Mullin's consolidation of its Chinese offices is déjà vu among U.S. firms. A couple of years ago, Winston & Strawn did the same thing by closing its Beijing office, and a few years before that Vinson & Elkins did the opposite by shuttering in Shanghai.

At the moment, 42 of the Am Law 100 operate a Beijing office, according to official Chinese records, and 41 are in Shanghai. Only 27 of those firms have offices in both cities.

Most firms are in Beijing for similar reasons: As the seat of the central government, Beijing is where all the top regulators are and where the national laws and regulations get made. In China, nearly every transaction has a regulatory component, so dealing with regulators is key to making deals.

For securities lawyers, for example, although Beijing hosts neither of the main stock exchanges, the China Securities Regulatory Commission approves all domestic listings and reviews matters related to all overseas listings. Wall Street firms are almost all in Beijing; in fact, most of them—Cleary Gottlieb Steen & Hamilton; Davis Polk & Wardwell; Milbank; Paul, Weiss, Rifkind, Wharton & Garrison; Simpson Thacher & Bartlett; and Sullivan & Cromwell—are only in Beijing.

And, of course, the fact that Beijing is home to the headquarters of China's largest state-owned enterprises appeals to Big Law. Many have been vying to represent big-ticket restructuring and M&A deals and overseas investments for those entities. In 2013, when Vinson & Elkins pulled out of Shanghai, it was betting on a rising wave of Chinese energy enterprises buying assets around the globe, and Beijing is where those decisions are made.

While not much of the national agenda is decided there, Shanghai has traditionally been a preferred location of multinationals' Chinese or regional headquarters. Many law firms came to Shanghai following their clients, including smaller regional firms such as Minneapolis-based Fredrikson & Byron.

But to Big Law, Shanghai has little to offer beyond an easier transition for those new to China. That is gradually changing. The one thing unique to Shanghai is the Free Trade Zone, where foreign law firms are able to join with domestic firms and gain access to Chinese law capability.

So far, Baker McKenzie and Hogan Lovells are the only U.S. firms to do so. Proximity aside, Beijing's concentration of regulators and most of China's top universities also draws in investments and businesses. Plus, it's home to China's earliest technology hub, Zhongguancun. Many of China's highest-valued unicorns are based in Beijing.

Both cities attract firms that are chasing so-called “new economy” work. For venture capital specialists, Beijing has Gunderson Dettmer, Shanghai has Fenwick & West, and Cooley and Wilson Sonsini Goodrich & Rosati are in both.

A third option has recently emerged, in Shenzhen, which apparently has taken over Zhongguancun as China's new Silicon Valley. Shenzhen is home to some of the best-known Chinese technology companies—Huawei Technologies Co. Ltd., ZTE Corp. and Tencent Holdings Ltd.

Practice in Shenzhen is so far only related to patents and technology, but the city has broken Beijing and Shanghai's three-decade run of dominance. And more firms are coming. Stay tuned.