The Key System was the eventual culmination of a number of street car companies in the Oakland (CA) and surrounding cities - beginning in the late 1800's. I think the actual Key System was started in 1903 - an interesting side note is that the original diamond-shaped pantograph was invented by a Key System engineer about the same time for use on the electrified interurban trains. In addition to serving local transit needs the Key System provided connection to the trans-bay ferries operating between the East Bay and San Francisco - Southern Pacific operated a competitive rail commuter system and also operated some of the transbay ferries. As noted by a previous post, there was a Key System connection at the Southern Pacific station in Oakland - a station that is still standing but is now an abandoned, graffitied eyesore. The California Zephyr now terminates in Emeryville (at a relatively new station but completely devoid of the beauty and charm of the old Oakland station before it was abandoned), where there is a bus connection to San Francisco.
The heyday of the Key System operation (which was a privately owned company) was during WWII, but by 1948, all the local Key System trains were gone. There were interurban trains running across the San Francisco - Oakland Bay Bridge - starting in 1938 and lasting until 1958 (the routes were taken over by the publically owned AC Transit bus system in 1960). The demise of the Key System was brought about by a number of factors (I didn't arrive in Berkeley until the late 60's, so I have no direct experience) - the 'usual' conflation of rising maintenance costs (or its corollary, increasingly unreliable or poor service), the rise of the private automobile (hey, this was California) and - some would argue - most importantly, the purchase of controlling interest by the infamous National City Lines in 1946. National City Lines was owned by General Motors, Phillips Petroleum, Firestone Tire (I think Standard Oil/Chevron and Goodyear may have also been involved, my history is a bit hazy on this) and, as you would expect from that type of consortium, an electrified steel-wheeled train running on steel tracks was antithetical to their corporate interests. Even though NCL was convicted of monopolistic practices, they did succeed in their goal of turning the Key system into a bunch of buses (this was prior to AC transit) that have since disappeared.
Its no small irony that the current BART system serves a similar transit function - though many would argue that the current configuration of lines in the East Bay is mainly to serve the transbay commuters and doesn't provide the same local transit service needs that the Key System did. Even more ironic, the BART system, initially a commission to investigate Bay Area transit needs, was set up in 1951 and turned into a transit district in 1957 - both before the final demise of the Key System in 1958. I have no idea to what extent the original BART commission examined using the then existing Key System as part of a future transit system. I'm sure that the trackage on the lower deck of the Bay Bridge wouldn't have survived in any event, given the increasing pressure of additional automobile and truck traffic.
One final note - one of the problems with any of these systems is the need to not only maintain and repair the infrastructure, but to update and 'modernize'. The Key System operated for 40+ years (the transbay trains for 20 years) and an aging infrastructure contributed to its downfall. Initial designs for BART were done in 1961 - 55 years ago and operations started in 1972, 44 years ago (transbay in 1974). BART has plans to replace its fleet of 600+ cars, but slowly - and at the same time the main parts of the infrastructure - the tracks, control systems, power systems, etc. - are rapidly exceeding their service life, not to mention their way out-of-date control systems, and BART has recently experienced major system problems whose causes are not well understood (related to new third-rail power systems, apparently). The Washington Metro - a system that followed BART by a few years and learned much from BART's design and construction - just shut down for 29 hours during the middle of the week over concerns about operational safety (haven't read much about their findings, etc., yet). At the same time, these systems have become vital to regional transit - BART has seen it ridership grow by more than 100,000 daily riders (up from something like 250,000 plus) over the past five years. I'm sure this exceeds whatever the BART planners had in mind in the early 60's - though their expectations were for 90 second headways between trains in the transbay tube - something that has never been realized due to poor control system design. Currently, they are only allowed to operate one train in the tube at a time (in each direction) - the transit time is several minutes. Its hard to imagine 'replacing' these systems completely (as BART effectively did for the Key System), but the political will to support public transit systems is shaky, at best.