When I started writing about cocktails and spirits about twenty years ago, there were three cities in which one could reliably find a delicious cocktail: New York, London and San Francisco.

New York is easy to explain. It was—and still is—the home of pioneering bartender Dale DeGroff, who inspired a new generation of bartenders and drinkers. While I never did get a chance to sit at his bar in the legendary Rainbow Room, I did enjoy a few rounds at the short-lived Blackbird, where he ran the beverage program.

London makes sense to me, since there is a rich British drinking culture, which kept many classic cocktails alive while Americans were forgetting their mixological roots. And that’s not to mention a number of fine bars that had been run by Yankees fleeing Prohibition—including legendary barman Harry Craddock who managed the Savoy’s American Bar—which continue to be havens for drinks lovers. And a crop of modern bartenders, including Dick Bradsell and Ben Reed, that helped to excite people about drinking new concoctions.

But why San Francisco? The answer isn’t quite as obvious.

There is no denying that the Bay Area has a long bar history; at the turn of the century it boasted some of the world’s finest watering holes and bartenders, and was home to Trader Vic, who started his tiki chain there. His legacy endured for decades. Tiki establishments remained open even during the cocktail dark ages of the ’70s, ’80s and ’90s.

While that deep liquor foundation was extremely important for making the city a modern cocktail center, I think there are several factors—independent of the drinks world—that are important to consider.

Across the bay, in Berkeley, Alice Waters turned her signature farm-to-table cooking style into an international movement. While we now often take it for granted, it was a huge development and has affected how food is grown, bought and, of course, consumed around the country. Her focus on using fresh, seasonal and local ingredients perfectly dovetailed with the area’s nascent drinks scene. I don’t think the food movement gets enough credit for helping to educate both drinkers and bartenders on the merits of using fresh produce and sparking an interest in the backstory of cocktails and spirits. Bartenders in San Francisco, unlike others in the United States, had access to a huge selection of produce early on—a bounty that has only increased with the rise of farmer’s markets.

A few hours north of the city, Napa and Sonoma were also booming. Northern California was becoming synonymous with fine wine and San Francisco’s restaurants and bars were expected to offer a wide range of bottles produced in the state and beyond. The local wine industry inspired a local craft beer and liquor scene. Before boutique distilleries populated every state, San Francisco was home to a number of them, including the pioneering Anchor Distilling. (It was recently renamed Hotaling & Co.) The company came out with its throwback Old Potrero whiskies and Junipero Gin long before traditional spirits were trendy.

At the same time, just as with the gold rush, thanks to the rise of the internet and consumer electronics, the city found itself at the center of a new economic pandemonium. Silicon Valley became a beacon for people around the world that flocked to the Bay Area to work at startups and potentially become stock option millionaires.

Just like gold miners relaxing at bars between stints panning for nuggets, the city’s would-be tech moguls unwound after long days at their stand-up desks at craft cocktail bars that opened around the area. The city also had its own cocktail champion, Tony Abou-Ganim, who trained many of the top bartenders and created the city’s signature drink, the Cable Car (spiced rum, orange Curaçao and lemon juice). His time running the bar at Harry Denton’s Starlight Room was a key moment in the rise of the Bay Area’s mixology scene.

Not that many years later, movers and shakers were going to the city’s gritty Tenderloin neighborhood to try to get into the modern speakeasy Bourbon & Branch. Being able to find the clandestine bar and score a table was the ultimate power move if you were trying to close a deal. Its owners went on to open a number of other popular spots in the area.

Recognizing an increasingly engaged and well-heeled clientele, bartenders and bar owners from around the country flocked to the city to mix drinks. (The same thing, of course, happened during the gold rush.)

For a small city, drinkers soon had a staggering selection of bars to choose from, including the rum-mecca Smuggler’s Cove, Trick Dog, Cantina, Elixir, Bar Agricole, Hog & Rocks, Irish Bank, Pacific Cocktail Haven, Wildhawk, ABV, 15 Romolo and Comstock Saloon.

The city is so well-established now that bartenders, who have worked in San Francisco, decamp to other cities to open their own bars based on their Bay Area experiences. And just like in the dot-com world, that kind of influence means a lot.