Well, a shutoff valve is just a valve, really, but one that's specifically there to shut off the flow of something (like water) that's virtually always on. Any building with running water probably has several shutoff valves: a main one, and subsidiary ones for specific parts of the building, and usually also individual ones at each sink or toilet or other water-using device. The shutoff valve is there, of course, in case you have to shut the water off, for some reason -- generally to make some repair.

The problem is that since shutoff valves get used -- that is, shut off -- so very rarely, they can easy deteriorate in various ways without your being aware of it. Their stems can sieze up, meaning that when you try to shut the water off, the shutoff valve's handle snaps off. More frequently, the shutoff valve's washers or seals have deteriorated, meaning that the water flow is diminished to a trickle but not shut off entirely (or, in some cases, hardly diminished at all). In really extreme cases, the shutoff valve may disintegrate when you try to operate it, meaning that you now have two leaks to fix (one of them a big one) instead of one. (If the problem is that the shutoff valve, though not completely nonfunctional, still leaves a trickle of water flowing, this may prevent you from completing the original repair, since most pipe-joining methods -- e.g. soldering, cementing) require that the joint be absolutely dry.)

When a shutoff valve fails, you have little choice but to try to shut the water off farther upstream, so that you can both replace the broken shutoff valve and make your original repair. And, if your luck is really bad (i.e. if Mr. Murphy is particularly favoring you with his attentions today) you may chase a trail of broken shutoff valves right out to the water main in the street...

Whenever I install (or replace) a shutoff valve, I try to use a ball valve. They're a bit more expensive, but they're much more reliable; they're just about guaranteed to shut the water off completely even if they've been sitting there untouched for N years.