A well does not die, but rather reaches its "economic limit," the point at which the oil or gas coming out of it no longer covers the costs associated with operation. When this happens, tubing is removed and cement is pored to ensure hydrocarbon reservoirs remain separate from water and the cut off from the surface.
The pump head is then excavated and removed, a cap is welded in place, and the whole thing is buried.
With so many steps taking place down relatively narrow holes deep below the earth's surface, there is a lot of room for accidents to happen. As proven reserves shrink and become more difficult to replace, drillers are forced to search for deeper and less reliable sources of hydrocarbons and these places are often more difficult and dangerous to drill.