Typical houses have slanted roofs. This slant is meant to keep water from pooling on top of the roof, causing damage, and then leaking into a home. When an ice dam forms, water can't run off the roof and into the gutters or on the ground.
This situation occurs when temperatures dip below freezing. Very often, ice forms on the lowest parts of a roof. This ice creates a sort of frozen wall on the roof that actually works like a dam. When water melts on the roof, it melts on the highest point first. This can actually create a flood on top of a normal slanted roof.