If you have snow packed on your roof, the heat from inside of your house can rise up and melt it. That melted snow can then pool and refreeze into a sheet of ice at the edge of your roof. Voila! An ice dam.
That ice can block your gutters, which means trapped water flowing around up there will have nowhere to go—except, perhaps, down through your roof and into the structure of your home.