The cable car transformed the way people got around this city in the late 1800's. Before these modern marvels appeared on the street, the main transport up the steep hills were horse drawn carriages. Unfortunately, the horses often felt the sting of the whip as the driver pushed them to strain up these hills with a load of cargo or people in the wagon. As you can imagine, there were accidents, and some of them fatal, when the horses faltered or were not strong enough to pull the load.
Andrew Hallidie, a Scotsman by birth, immigrated to this country and immediately saw the problem and began to search for a solution. He didn't have to look far. In his profession as a wire rope manufacturer he saw several creative uses for his product, and he began to see how it could be used to transport not only supplies, but people up the steepest hills in San Francisco.
On August 1st, 1873, he gave his first demonstration of the car that would run on a cable system buried just below the surface of the road. It was a success, and the system grew to include 112 miles of line and became one of the main modes of transportation up Nob Hill, Russian Hill, Telegraph Hill, etc.
The invention of electricity and gas powered engines caused the decline and almost demise of this San Francisco icon, but the people struggled for many years to preserve a piece of this history, and in 1964 the remaining cable car system was declared a National Historic Landmark. It's a type of moving museum and a way to actually experience history as you tour the city.
Research: Historic San Francisco: A Concise History and Guide, by Rand Richards. (Awesome book)