There's a bit of understandable confusion regarding the names of the many vehicles that make up The City's public transport system or MUNI. Calling a cable car a "trolley" is almost as bad (but not quite) as referring to this city as "Frisco" (or the new horror, "San Fran")*. Part of the confusion comes from the fact that most American cities have neither of these once popular forms of transport and people just aren't used to having to distinguish between two things they rarely see. It's pretty simple; trolleys (or streetcars) use a pole or pantograph to draw their power from overhead lines and cable cars are pulled along by a non-electrified underground cable. The Cable Car system is mechanically complex and cumbersome (hence the fact that San Francisco, the Cable Car's birthplace, is the only city where you'll find the things running). You can learn more about this fascinating network by visiting the Cable Car Barn at 1201 Mason at Washington. It's a remarkable monument to Victorian engineering and admission is free. I've left a little movie here that features the big wheels (or sheaves, pronounced "shivs") that pull the cables underneath the street of San Francisco.
*I'll pretty much leave this debate for other forums. My understanding, which was instilled in me as a child, was that The City was named in honor of Saint Francis of Assisi (an all-around good guy regardless of your religious faith or lack of it) and therefore should NEVER be referred to using a diminutive. We don't say Saint Lou or San Joe, or at least we shouldn't. I think "San Fran" is infinitely uglier than "Frisco" ever was.