At the component level, the devices used in most surge protected circuits are called metal oxide varistors, or MOVs. When the voltage across a MOV reaches above a certain threshold, the MOV begins to conduct, effectively shunting the voltage spike away long enough to protect the device. Generally they can only take so many hits before they wear out, but they are generally a very affordable option. Some devices have MOVs built into the power supply itself, but even so, I typically use surge-protected power strips on any electronics I consider valuable.