Ice dams are not caused by roofing, ventilation or gutter problems, as often believed. The real problem is a home that is leaking warm air.
Due to inadequate air sealing, heat from the home's interior gets into the attic and melts the underside of the snow on the roof. The melted snow water flows down the roof surface until reaching a cold spot, such as the eaves or soffit, where it forms a frozen dam.
Over time, especially with a snow-covered roof in subfreezing temperatures, more ice can build up. Eventually, water starts seeping into the home.
Because the primary cause of ice dams is warm air leaking from the attic, the best prevention is to seal leaks with caulking or expanding spray foam, with attic insulation installed to a minimum of R-50 as space allows.