SF has been, and is still in a decline economically. Regulations, combined with the fact that the city lets homeless people live right in the same space as high end hotels and convention locations, is driving any hotel related business (conventions) to other places, like Las Vegas. Plus, they charge outrageous rates for anyhthing that the city has any control over, either directly or through surcharges or taxes. Las Vegas actually wants your business, so they don't pile on like that.
SF itself is not that big relative to other world class cities. It's got to be comfortably under a million in population, with the entire bay area being around 8 million. I'm speculating on those numbers since I haven't checked in a while.
It's the rest of the bay area that is the real powerhouse, economically. The south bay, including San Jose, Palo Alto, Redwood City, Santa Clara, Sunnyvale, Cupertino, Milpitas, etc., are where the high tech companies want to be, because the housing is cheaper (and that's relative, since a 1700 sq. foot home in a nice middle class area can cost at least $1 million) which means that's where the talent pool is, and of course the big plus is you don't have to deal with the crazy city govt in SF.