Ice dams are literally dams of ice that form on roofs and cause water to back up. Ice dams form when the snow that touches the roof melts, and then that water freezes again before running off the roof. This usually happens at the edges of roofs, but not always. If you'd prefer to watch a video that explains everything in this marathon blog post, I've created a marathon video that covers all of this. This video is a heavily-edited, stripped-down version of my one-hour class on ice dams.
Here's a diagram showing the basics of how ice dams form, courtesy of The Ice Dam Company.

The best way to prevent ice dams from forming is to address the three factors in your attic that contribute to ice dams; attic bypasses, insulation, and ventilation.
Attic Air Leaks (aka attic bypasses)
Attic air leaks cause ice dams. In almost every house with ice dams, there will be attic air leaks directly below the beginnings of the ice dam. Attic bypasses are passageways for warmed air to enter the attic space, and traditional insulation won't fix this. The photos below show some common attic bypasses that can be found in just about any older house. The image series below shows how an infrared camera can be used by a home inspector or energy auditor to locate these bypasses.

The photo below shows one of the largest and most common bypasses, which is the space around the furnace and/or water heater vent. Sometimes these are huge. The one shown below is relatively small, but allows a lot of air to leak up into the attic.

In the photo below, you can see several holes in the top plate of a wall that were drilled for wires to pass through. These holes could all be easily filled with spray foam, but finding these holes all over the attic would be a challenge without first removing the insulation, or performing an infrared inspection with a thermal imaging camera. The insulation had to be pushed aside to find these and take this photo.

With additions, the transitions between the 'new' and 'old' construction seem to always be sources of attic bypasses. The gap below was easily identified with the use of an infrared camera, but a lot of insulation had to be moved to get to the bottom of it.

When plumbing vents enter the attic, the space around the vents needs to be sealed. This one obviously wasn't.